@@ -696,11 +696,17 @@ export class IgxHierarchicalGridNavigationService extends IgxGridNavigationServi
696696 cell . focus ( { preventScroll : true } ) ;
697697 }
698698 } else {
699- const cellElem = elem . querySelector ( ` ${ cellSelector } ` ) ;
700- const rowIndex = parseInt ( cellElem . getAttribute ( 'data-rowindex' ) , 10 ) ;
701- grid . navigation . performHorizontalScrollToCell ( rowIndex , visibleColumnIndex ) ;
699+ this . horizontalScrollGridToIndex ( grid , visibleColumnIndex , ( ) => {
700+ this . focusNextRow ( elem , visibleColumnIndex , grid , isSummary ) ;
701+ } ) ;
702702 }
703703 }
704+ public getColumnUnpinnedIndex ( visibleColumnIndex : number , grid ?: IgxHierarchicalGridComponent ) {
705+ const currGrid = grid || this . grid ;
706+ const column = currGrid . unpinnedColumns . find ( ( col ) => ! col . columnGroup && col . visibleIndex === visibleColumnIndex ) ;
707+ return currGrid . pinnedColumns . length ? currGrid . unpinnedColumns . filter ( ( c ) => ! c . columnGroup ) . indexOf ( column ) :
708+ visibleColumnIndex ;
709+ }
704710
705711 private focusPrevRow ( elem , visibleColumnIndex , grid , inChild ?, isSummary ?) {
706712 const lastCellIndex = grid . unpinnedColumns [ grid . unpinnedColumns . length - 1 ] . visibleIndex ;
@@ -739,7 +745,7 @@ export class IgxHierarchicalGridNavigationService extends IgxGridNavigationServi
739745 }
740746
741747 private horizontalScrollGridToIndex ( grid , visibleColumnIndex , callBackFunc ) {
742- const unpinnedIndex = this . getColumnUnpinnedIndex ( visibleColumnIndex ) ;
748+ const unpinnedIndex = this . getColumnUnpinnedIndex ( visibleColumnIndex , grid ) ;
743749 grid . parentVirtDir . onChunkLoad
744750 . pipe ( first ( ) )
745751 . subscribe ( callBackFunc ) ;
0 commit comments