Skip to content

Commit 3bdb38f

Browse files
authored
feat: support shift+tab hotkey (#1143)
1 parent 2b29dd9 commit 3bdb38f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/sdk/src/components/grid/hooks/useKeyboardSelection.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,14 @@ export const useKeyboardSelection = (props: ISelectionKeyboardProps) => {
120120
);
121121

122122
useHotkeys(
123-
'tab',
123+
['tab', 'shift+tab'],
124124
() => {
125125
const [columnIndex, rowIndex] = selection.ranges[0];
126-
const newColumnIndex = Math.min(columnIndex + 1, columnCount - 1);
126+
127+
let newColumnIndex = Math.min(columnIndex + 1, columnCount - 1);
128+
if (isHotkeyPressed('shift') && isHotkeyPressed('tab'))
129+
newColumnIndex = Math.max(columnIndex - 1, 0);
130+
127131
const newRange = <IRange>[newColumnIndex, rowIndex];
128132
const ranges = [newRange, newRange];
129133

0 commit comments

Comments
 (0)