@@ -274,7 +274,8 @@ describe('IgxHierarchicalGrid Basic Navigation', () => {
274274 expect ( childCell . rowIndex ) . toBe ( 0 ) ;
275275
276276 const currScrTop = hierarchicalGrid . verticalScrollContainer . getVerticalScroll ( ) . scrollTop ;
277- expect ( currScrTop ) . toBeLessThanOrEqual ( childGrid . rowHeight + 1 ) ;
277+ const childGridOffset = childGrid . nativeElement . offsetTop ;
278+ expect ( currScrTop ) . toBeLessThanOrEqual ( childGrid . rowHeight + 1 + childGridOffset ) ;
278279 } ) ) ;
279280
280281 it ( 'should allow navigating to bottom in child grid when child grid target row moves outside the parent view port.' , ( async ( ) => {
@@ -349,7 +350,29 @@ describe('IgxHierarchicalGrid Basic Navigation', () => {
349350 expect ( childFirstRowCell . rowIndex ) . toBe ( 0 ) ;
350351
351352 const currScrTop = hierarchicalGrid . verticalScrollContainer . getVerticalScroll ( ) . scrollTop ;
352- expect ( currScrTop ) . toBeLessThanOrEqual ( childGrid . rowHeight + 1 ) ;
353+ const childGridOffset = childGrid . nativeElement . offsetTop ;
354+ expect ( currScrTop ) . toBeLessThanOrEqual ( childGrid . rowHeight + 1 + childGridOffset ) ;
355+ } ) ) ;
356+
357+ it ( 'should scroll top of child grid into view when pressing Ctrl + Arrow Up when cell is selected in it.' , ( async ( ) => {
358+ hierarchicalGrid . verticalScrollContainer . scrollTo ( 3 ) ;
359+ await wait ( 100 ) ;
360+ fixture . detectChanges ( ) ;
361+
362+ const childGrid = hierarchicalGrid . hgridAPI . getChildGrids ( false ) [ 3 ] ;
363+ const childLastRowCell = childGrid . dataRowList . toArray ( ) [ 9 ] . cells . toArray ( ) [ 0 ] ;
364+ childLastRowCell . nativeElement . focus ( ) ;
365+ fixture . detectChanges ( ) ;
366+ childLastRowCell . nativeElement . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 'ArrowUp' , ctrlKey : true } ) ) ;
367+ await wait ( 100 ) ;
368+ fixture . detectChanges ( ) ;
369+ const childFirstRowCell = childGrid . dataRowList . toArray ( ) [ 0 ] . cells . toArray ( ) [ 0 ] ;
370+ expect ( childFirstRowCell . selected ) . toBe ( true ) ;
371+ expect ( childFirstRowCell . columnIndex ) . toBe ( 0 ) ;
372+ expect ( childFirstRowCell . rowIndex ) . toBe ( 0 ) ;
373+
374+ const currScrTop = hierarchicalGrid . verticalScrollContainer . getVerticalScroll ( ) . scrollTop ;
375+ expect ( currScrTop ) . toBeGreaterThanOrEqual ( 2000 ) ;
353376 } ) ) ;
354377
355378 it ( 'when navigating down from parent into child should scroll child grid to top and start navigation from first row.' , ( async ( ) => {
0 commit comments