Skip to content

Commit

Permalink
fix: layout grid arrow down and end problem
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer authored and AntonLantukh committed Feb 22, 2024
1 parent a6305ef commit 6a291a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ui-react/src/components/LayoutGrid/LayoutGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ const LayoutGrid = <Item extends object>({ className, columnCount, data, renderC
case 'ArrowUp':
return focusGridCell(previousRowIndex, currentColumnIndex);
case 'ArrowDown':
return focusGridCell(nextRowIndex, currentColumnIndex);
return focusGridCell(nextRowIndex, nextRowIndex === maxRow ? Math.min(currentColumnIndex, maxRightLastRow) : currentColumnIndex);
case 'Home':
if (ctrlKey) {
return focusGridCell(0, 0);
}
return focusGridCell(currentRowIndex, 0);
case 'End':
if (ctrlKey) {
return focusGridCell(maxRight, maxRightLastRow);
return focusGridCell(maxRow, maxRightLastRow);
}
return focusGridCell(currentRowIndex, maxRow);
return focusGridCell(currentRowIndex, maxRight);
case 'PageUp':
return focusGridCell(previousRowIndex, currentColumnIndex);
case 'PageDown':
Expand Down

0 comments on commit 6a291a7

Please sign in to comment.