Skip to content

Commit

Permalink
initial idea
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordon Ko committed Oct 7, 2023
1 parent 95489da commit 8448fdd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,23 @@ function DataGrid<R, SR, K extends Key>(
}
}

if (isCtrlKeyHeldDown(event) && event.shiftKey) {
const leftKey = isRtl ? 39 : 37;
const rightKey = isRtl ? 37 : 39;
if (keyCode === leftKey || keyCode === rightKey) {
const { idx } = selectedPosition;
const column = columns[idx];
if (column.resizable) {
const width = getColumnWidth(column);
const step = 10;
const isIncrease = keyCode === rightKey;
const newWidth = isIncrease ? Number(width) + step : Number(width) - step;
handleColumnResizeLatest(column, newWidth);
}
return;
}
}

switch (event.key) {
case 'Escape':
setCopiedCell(null);
Expand Down

0 comments on commit 8448fdd

Please sign in to comment.