Skip to content

Commit d86e1f5

Browse files
authored
Merge pull request #6445 from IgniteUI/mdragnev/fix-5126-8.2.x
fix(igxHGrid): Make sure visibleColumnIndex is not greater than columns length
2 parents a197cdd + c4130a9 commit d86e1f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@ export class IgxHierarchicalGridNavigationService extends IgxGridNavigationServi
675675
}
676676

677677
private focusNextRow(elem, visibleColumnIndex, grid, isSummary?) {
678+
const lastCellIndex = grid.unpinnedColumns[grid.unpinnedColumns.length - 1].visibleIndex;
679+
visibleColumnIndex = Math.min(lastCellIndex, visibleColumnIndex);
678680
const cellSelector = this.getCellSelector(visibleColumnIndex, isSummary);
679681
if (grid.navigation.isColumnFullyVisible(visibleColumnIndex) || grid.rowList.length === 0) {
680682
const cell =
@@ -707,6 +709,8 @@ export class IgxHierarchicalGridNavigationService extends IgxGridNavigationServi
707709
}
708710

709711
private focusPrevRow(elem, visibleColumnIndex, grid, inChild?, isSummary?) {
712+
const lastCellIndex = grid.unpinnedColumns[grid.unpinnedColumns.length - 1].visibleIndex;
713+
visibleColumnIndex = Math.min(lastCellIndex, visibleColumnIndex);
710714
if (grid.navigation.isColumnFullyVisible(visibleColumnIndex)) {
711715
const cellSelector = this.getCellSelector(visibleColumnIndex, isSummary);
712716
const cells = elem.querySelectorAll(`${cellSelector}[data-visibleIndex="${visibleColumnIndex}"]`);

0 commit comments

Comments
 (0)