Skip to content

Commit

Permalink
feat: support shift+tab hotkey (#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpodp0ra authored Dec 6, 2024
1 parent 2b29dd9 commit 3bdb38f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,14 @@ export const useKeyboardSelection = (props: ISelectionKeyboardProps) => {
);

useHotkeys(
'tab',
['tab', 'shift+tab'],
() => {
const [columnIndex, rowIndex] = selection.ranges[0];
const newColumnIndex = Math.min(columnIndex + 1, columnCount - 1);

let newColumnIndex = Math.min(columnIndex + 1, columnCount - 1);
if (isHotkeyPressed('shift') && isHotkeyPressed('tab'))
newColumnIndex = Math.max(columnIndex - 1, 0);

const newRange = <IRange>[newColumnIndex, rowIndex];
const ranges = [newRange, newRange];

Expand Down

0 comments on commit 3bdb38f

Please sign in to comment.