@@ -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,42 @@ test('Focused cell should be switched to the editing mode after onSaving\'s prom
10198 } ) ;
10299} ) ;
103100
101+ // T1190566
102+ test ( 'DataGrid - The "Cannot read properties of undefined error" occurs when using Tab while saving a promise' , async ( t ) => {
103+ const dataGrid = new DataGrid ( '#container' ) ;
104+ const resolveOnSavingDeferred = ClientFunction ( ( ) => ( window as any ) . deferred . resolve ( ) ) ;
105+
106+ await t
107+ . click ( dataGrid . getDataCell ( 0 , 0 ) . element )
108+ . typeText ( dataGrid . getDataCell ( 0 , 0 ) . element , 'new_value' )
109+ . pressKey ( 'enter tab tab' ) ;
110+ await resolveOnSavingDeferred ( ) ;
111+ await t . expect ( dataGrid . getDataCell ( 2 , 0 ) . isFocused ) . ok ( ) ;
112+ } ) . before ( async ( ) => {
113+ await ClientFunction ( ( ) => {
114+ ( window as any ) . deferred = $ . Deferred ( ) ;
115+ } ) ( ) ;
116+
117+ return createWidget ( 'dxDataGrid' , {
118+ dataSource : [
119+ { id : 1 , field1 : 'value1' } ,
120+ { id : 2 , field1 : 'value2' } ,
121+ { id : 3 , field1 : 'value3' } ,
122+ { id : 4 , field1 : 'value4' } ,
123+ ] ,
124+ keyExpr : 'id' ,
125+ showBorders : true ,
126+ columns : [ 'field1' ] ,
127+ editing : {
128+ mode : 'cell' ,
129+ allowUpdating : true ,
130+ } ,
131+ onSaving ( e ) {
132+ e . promise = ( window as any ) . deferred ;
133+ } ,
134+ } ) ;
135+ } ) ;
136+
104137test ( 'Tab key on editor should focus next cell if editing mode is cell' , async ( t ) => {
105138 const dataGrid = new DataGrid ( '#container' ) ;
106139
0 commit comments