@@ -301,6 +301,40 @@ describe('IgxGrid Multi Row Layout - Keyboard navigation #grid', () => {
301301 GridFunctions . verifyGridContentActiveDescendant ( GridFunctions . getGridContent ( fix ) , cell . nativeElement . id ) ;
302302 } ) ;
303303
304+ it ( 'should not return an out of bounds row index when navigating down from the last layout row' , ( ) => {
305+ fix . componentInstance . data = SampleTestData . contactInfoDataFull ( ) . slice ( 0 , 10 ) ;
306+ fix . componentInstance . colGroups = [ {
307+ group : 'group1' ,
308+ columns : [
309+ { field : 'ID' , rowStart : 1 , colStart : 1 } ,
310+ { field : 'CompanyName' , rowStart : 1 , colStart : 2 } ,
311+ { field : 'ContactName' , rowStart : 1 , colStart : 3 } ,
312+ { field : 'ContactTitle' , rowStart : 1 , colStart : 4 } ,
313+ { field : 'Address' , rowStart : 1 , colStart : 5 } ,
314+ { field : 'City' , rowStart : 2 , colStart : 1 } ,
315+ { field : 'Region' , rowStart : 2 , colStart : 2 } ,
316+ { field : 'PostalCode' , rowStart : 2 , colStart : 3 } ,
317+ { field : 'Phone' , rowStart : 2 , colStart : 4 } ,
318+ { field : 'Fax' , rowStart : 2 , colStart : 5 }
319+ ]
320+ } ] ;
321+ fix . detectChanges ( ) ;
322+
323+ const grid = fix . componentInstance . grid ;
324+ const lastRowIndex = grid . dataView . length - 1 ;
325+ const navService = grid . navigation as IgxGridMRLNavigationService ;
326+ const col = grid . getColumnByName ( 'City' ) ;
327+ navService . setActiveNode ( {
328+ row : lastRowIndex ,
329+ column : col . visibleIndex ,
330+ layout : navService . layout ( col . visibleIndex )
331+ } ) ;
332+
333+ const nextPos = navService . getNextVerticalPosition ( ) ;
334+ expect ( nextPos . row ) . toBe ( lastRowIndex ) ;
335+ expect ( nextPos . column ) . toBe ( navService . activeNode . column ) ;
336+ } ) ;
337+
304338 it ( 'should navigate up correctly' , ( ) => {
305339 fix . componentInstance . colGroups = [ {
306340 group : 'group1' ,
0 commit comments