From 62a81180c84f7782b14b69b56f891c810e7d0f69 Mon Sep 17 00:00:00 2001 From: Clauderic Demers Date: Fri, 20 Sep 2024 14:58:17 -0400 Subject: [PATCH] Add `tab` to the list of end keycodes --- .changeset/keyboard-tab-end.md | 5 +++++ packages/dom/src/core/sensors/keyboard/KeyboardSensor.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/keyboard-tab-end.md diff --git a/.changeset/keyboard-tab-end.md b/.changeset/keyboard-tab-end.md new file mode 100644 index 00000000..8cb049f0 --- /dev/null +++ b/.changeset/keyboard-tab-end.md @@ -0,0 +1,5 @@ +--- +'@dnd-kit/dom': patch +--- + +Added `Tab` to the list of default keycodes that end the current drag operation. diff --git a/packages/dom/src/core/sensors/keyboard/KeyboardSensor.ts b/packages/dom/src/core/sensors/keyboard/KeyboardSensor.ts index 100cea93..5edb576f 100644 --- a/packages/dom/src/core/sensors/keyboard/KeyboardSensor.ts +++ b/packages/dom/src/core/sensors/keyboard/KeyboardSensor.ts @@ -34,7 +34,7 @@ export interface KeyboardSensorOptions { const DEFAULT_KEYBOARD_CODES: KeyboardCodes = { start: ['Space', 'Enter'], cancel: ['Escape'], - end: ['Space', 'Enter'], + end: ['Space', 'Enter', 'Tab'], up: ['ArrowUp'], down: ['ArrowDown'], left: ['ArrowLeft'],