Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-worklist-data-grid] Fixes column index out of range for displayed columns #2071

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/terra-data-grid/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* Added
* Added support for orange and green column highlighting.

* Fixed
* Fixes column index out of bounds in row selection mode.

## 1.18.0 - (March 5, 2024)

* Changed
Expand Down
10 changes: 6 additions & 4 deletions packages/terra-data-grid/src/DataGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,12 @@ const DataGrid = forwardRef((props, ref) => {
setFocusedRow(newRowIndex);
setFocusedCol(newColIndex);

focusedCellRef.current = {
rowId: grid.current.rows[newRowIndex].getAttribute('data-row-id'),
columnId: displayedColumns[newColIndex].id,
};
if (newColIndex < displayedColumns.length) {
focusedCellRef.current = {
rowId: grid.current.rows[newRowIndex].getAttribute('data-row-id'),
columnId: displayedColumns[newColIndex].id,
};
}

if (makeActiveElement) {
let focusedCell;
Expand Down
Loading