@@ -1340,6 +1340,90 @@ test('Tab key on the focused group row should be handled by default behavior (T8
13401340 } ) ;
13411341} ) ;
13421342
1343+ test ( 'DataGrid - Focus should move back to headers on Shift+Tab when multiple grouping is applied (T1325775)' , async ( t ) => {
1344+ const dataGrid = new DataGrid ( '#container' ) ;
1345+ const headerRow = dataGrid . getHeaders ( ) . getHeaderRow ( 0 ) ;
1346+ const headerCell = headerRow . getHeaderCell ( 2 ) ;
1347+ const stateGroupRow = dataGrid . getGroupRow ( 0 ) ;
1348+ const cityGroupRow = dataGrid . getGroupRow ( 1 ) ;
1349+ const firstDataCell = dataGrid . getDataCell ( 2 , 2 ) ;
1350+
1351+ await t
1352+ . expect ( dataGrid . isReady ( ) )
1353+ . ok ( ) ;
1354+
1355+ await addFocusableElementBefore ( '#container' ) ;
1356+
1357+ await t
1358+ . click ( Selector ( '#focusable-start' ) )
1359+ . pressKey ( 'tab' )
1360+ . expect ( headerCell . isFocused )
1361+ . ok ( )
1362+
1363+ . pressKey ( 'tab' )
1364+ . expect ( stateGroupRow . isFocused )
1365+ . ok ( )
1366+
1367+ . pressKey ( 'tab' )
1368+ . expect ( cityGroupRow . isFocused )
1369+ . ok ( )
1370+
1371+ . pressKey ( 'tab' )
1372+ . expect ( firstDataCell . isFocused )
1373+ . ok ( )
1374+
1375+ . pressKey ( 'shift+tab' )
1376+ . expect ( cityGroupRow . isFocused )
1377+ . ok ( )
1378+
1379+ . pressKey ( 'shift+tab' )
1380+ . expect ( stateGroupRow . isFocused )
1381+ . ok ( )
1382+
1383+ . pressKey ( 'shift+tab' )
1384+ . expect ( headerCell . isFocused )
1385+ . ok ( ) ;
1386+ } ) . before ( async ( ) => {
1387+ await createWidget ( 'dxDataGrid' , {
1388+ showBorders : true ,
1389+ keyExpr : 'id' ,
1390+ dataSource : [
1391+ {
1392+ id : 1 ,
1393+ state : 'Arkansas' ,
1394+ city : 'Bentonville' ,
1395+ company : 'Super Mart of the West' ,
1396+ } ,
1397+ {
1398+ id : 2 ,
1399+ state : 'Arkansas' ,
1400+ city : 'Bentonville' ,
1401+ company : 'Electronics Depot' ,
1402+ } ,
1403+ {
1404+ id : 3 ,
1405+ state : 'California' ,
1406+ city : 'Cupertino' ,
1407+ company : 'Braeburn' ,
1408+ } ,
1409+ ] ,
1410+ grouping : {
1411+ autoExpandAll : true ,
1412+ } ,
1413+ columns : [
1414+ {
1415+ dataField : 'state' ,
1416+ groupIndex : 0 ,
1417+ } ,
1418+ {
1419+ dataField : 'city' ,
1420+ groupIndex : 1 ,
1421+ } ,
1422+ 'company' ,
1423+ ] ,
1424+ } ) ;
1425+ } ) ;
1426+
13431427test ( 'Row should not be focused by "focusedRowIndex" after change "pageIndex" by pager if "autoNavigateToFocused" row is false' , async ( t ) => {
13441428 const dataGrid = new DataGrid ( '#container' ) ;
13451429 await t
0 commit comments