@@ -916,6 +916,33 @@ describe('IgxHierarchicalGrid Complex Navigation #hGrid', () => {
916916 expect ( lastCell . rowIndex ) . toBe ( 4 ) ;
917917
918918 } ) ) ;
919+
920+ it ( 'should navigate to the first cell of next row using Tab from last cell in the row above' , ( async ( ) => {
921+ hierarchicalGrid . expandChildren = false ;
922+ hierarchicalGrid . height = '600px' ;
923+ hierarchicalGrid . width = '1000px' ;
924+ fixture . componentInstance . rowIsland . height = '350px' ;
925+ fixture . detectChanges ( ) ;
926+ await wait ( 100 ) ;
927+
928+ const row = hierarchicalGrid . getRowByIndex ( 0 ) ;
929+ ( row as IgxHierarchicalRowComponent ) . toggle ( ) ;
930+ await wait ( 100 ) ;
931+ fixture . detectChanges ( ) ;
932+
933+ const cell = hierarchicalGrid . getCellByColumn ( 2 , 'childData2' ) ;
934+ cell . nativeElement . dispatchEvent ( new Event ( 'focus' ) ) ;
935+ await wait ( 100 ) ;
936+ fixture . detectChanges ( ) ;
937+
938+ UIInteractions . triggerKeyDownEvtUponElem ( 'Tab' , cell . nativeElement , true ) ;
939+ await wait ( 100 ) ;
940+ fixture . detectChanges ( ) ;
941+
942+ const currentCell = hierarchicalGrid . getCellByColumn ( 3 , 'ID' ) ;
943+ expect ( currentCell . focused ) . toBe ( true ) ;
944+ expect ( currentCell . rowIndex ) . toBe ( 3 ) ;
945+ } ) ) ;
919946} ) ;
920947
921948describe ( 'IgxHierarchicalGrid Multi-layout Navigation #hGrid' , ( ) => {
@@ -1192,52 +1219,6 @@ describe('IgxHierarchicalGrid Smaller Child Navigation #hGrid', () => {
11921219 expect ( secondChildCell . focused ) . toBe ( true ) ;
11931220 } ) ) ;
11941221} ) ;
1195- describe ( 'IgxHierarchicalGrid Specific Scenarios Navigation' , ( ) => {
1196- configureTestSuite ( ) ;
1197- let fixture ;
1198- let hierarchicalGrid : IgxHierarchicalGridComponent ;
1199- beforeEach ( async ( ( ) => {
1200- TestBed . configureTestingModule ( {
1201- declarations : [
1202- IgxHierarchicalGridSpecificScenarioComponent
1203- ] ,
1204- imports : [
1205- NoopAnimationsModule , IgxHierarchicalGridModule ]
1206- } ) . compileComponents ( ) ;
1207- } ) ) ;
1208- beforeEach ( async ( ( ) => {
1209- fixture = TestBed . createComponent ( IgxHierarchicalGridSpecificScenarioComponent ) ;
1210- fixture . detectChanges ( ) ;
1211- hierarchicalGrid = fixture . componentInstance . hgrid ;
1212- setupHierarchicalGridScrollDetection ( fixture , hierarchicalGrid ) ;
1213- } ) ) ;
1214-
1215- it ( 'should navigate to the first cell of next row using Tab from last cell in the row above' , ( async ( ) => {
1216- const row = hierarchicalGrid . getRowByIndex ( 0 ) ;
1217- ( row as IgxHierarchicalRowComponent ) . toggle ( ) ;
1218- await wait ( 100 ) ;
1219- fixture . detectChanges ( ) ;
1220-
1221- const cell = hierarchicalGrid . getCellByColumn ( 2 , 'ProductName' ) ;
1222- cell . nativeElement . focus ( ) ;
1223- await wait ( 100 ) ;
1224- fixture . detectChanges ( ) ;
1225-
1226- const keyboardEvent = new KeyboardEvent ( 'keydown' , {
1227- key : 'Tab'
1228- } ) ;
1229- cell . dispatchEvent ( keyboardEvent ) ;
1230- await wait ( 100 ) ;
1231- fixture . detectChanges ( ) ;
1232-
1233- const currentCell = hierarchicalGrid . getCellByColumn ( 3 , 'ID' ) ;
1234- expect ( currentCell . focused ) . toBe ( true ) ;
1235- expect ( currentCell . rowIndex ) . toBe ( 3 ) ;
1236-
1237-
1238- } ) ) ;
1239-
1240- } ) ;
12411222
12421223@Component ( {
12431224 template : `
@@ -1335,31 +1316,3 @@ export class IgxHierarchicalGridMultiLayoutComponent extends IgxHierarchicalGrid
13351316 </igx-hierarchical-grid>`
13361317} )
13371318export class IgxHierarchicalGridSmallerChildComponent extends IgxHierarchicalGridTestBaseComponent { }
1338-
1339- @Component ( {
1340- template : `
1341- <igx-hierarchical-grid #grid1 [height]="'400px'" [width]="'500px'" [data]="data" [autoGenerate]="true"
1342- [expandChildren]='false' #hierarchicalGrid>
1343- <igx-row-island [key]="'childData'" [autoGenerate]="true" [expandChildren]='true' [height]="'200px'" #rowIsland>
1344- </igx-row-island>
1345- </igx-hierarchical-grid>`
1346- } )
1347- export class IgxHierarchicalGridSpecificScenarioComponent extends IgxHierarchicalGridTestBaseComponent {
1348- constructor ( ) {
1349- super ( ) ;
1350- this . data = this . generateData ( 20 , 2 ) ;
1351- }
1352- generateData ( count : number , level : number ) {
1353- const prods = [ ] ;
1354- const currLevel = level ;
1355- let children ;
1356- for ( let i = 0 ; i < count ; i ++ ) {
1357- if ( level > 0 ) {
1358- children = this . generateData ( count / 2 , currLevel - 1 ) ;
1359- }
1360- prods . push ( {
1361- ID : i , ProductName : 'Product: A' + i , childData : children } ) ;
1362- }
1363- return prods ;
1364- }
1365- }
0 commit comments