@@ -67,14 +67,11 @@ test('Focused cell should be switched to the editing mode after onSaving\'s prom
6767 const dataGrid = new DataGrid ( '#container' ) ;
6868 const resolveOnSavingDeferred = ClientFunction ( ( ) => ( window as any ) . deferred . resolve ( ) ) ;
6969
70- // act
7170 await t
7271 . click ( dataGrid . getDataCell ( 0 , 0 ) . element )
7372 . typeText ( dataGrid . getDataCell ( 0 , 0 ) . element , 'new_value' )
7473 . pressKey ( 'tab tab' ) ;
7574 await resolveOnSavingDeferred ( ) ;
76-
77- // assert
7875 await t . expect ( dataGrid . getDataCell ( 2 , 0 ) . isEditCell ) . ok ( ) ;
7976} ) . before ( async ( ) => {
8077 await ClientFunction ( ( ) => {
@@ -101,6 +98,41 @@ test('Focused cell should be switched to the editing mode after onSaving\'s prom
10198 } ) ;
10299} ) ;
103100
101+ test ( 'DataGrid - The "Cannot read properties of undefined error" occurs when using Tab while saving a promise (T1190566)' , async ( t ) => {
102+ const dataGrid = new DataGrid ( '#container' ) ;
103+ const resolveOnSavingDeferred = ClientFunction ( ( ) => ( window as any ) . deferred . resolve ( ) ) ;
104+
105+ await t
106+ . click ( dataGrid . getDataCell ( 0 , 0 ) . element )
107+ . typeText ( dataGrid . getDataCell ( 0 , 0 ) . element , 'new_value' )
108+ . pressKey ( 'enter tab tab' ) ;
109+ await resolveOnSavingDeferred ( ) ;
110+ await t . expect ( dataGrid . getDataCell ( 2 , 0 ) . isFocused ) . ok ( ) ;
111+ } ) . before ( async ( ) => {
112+ await ClientFunction ( ( ) => {
113+ ( window as any ) . deferred = $ . Deferred ( ) ;
114+ } ) ( ) ;
115+
116+ return createWidget ( 'dxDataGrid' , {
117+ dataSource : [
118+ { id : 1 , field1 : 'value1' } ,
119+ { id : 2 , field1 : 'value2' } ,
120+ { id : 3 , field1 : 'value3' } ,
121+ { id : 4 , field1 : 'value4' } ,
122+ ] ,
123+ keyExpr : 'id' ,
124+ showBorders : true ,
125+ columns : [ 'field1' ] ,
126+ editing : {
127+ mode : 'cell' ,
128+ allowUpdating : true ,
129+ } ,
130+ onSaving ( e ) {
131+ e . promise = ( window as any ) . deferred ;
132+ } ,
133+ } ) ;
134+ } ) ;
135+
104136test ( 'Tab key on editor should focus next cell if editing mode is cell' , async ( t ) => {
105137 const dataGrid = new DataGrid ( '#container' ) ;
106138
0 commit comments