Skip to content

Commit c4130a9

Browse files
authored
Merge branch '8.2.x' into mdragnev/fix-5126-8.2.x
2 parents ed41453 + a197cdd commit c4130a9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid-navigation.service.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)