Skip to content

Commit

Permalink
Only restore focus after drop if the activatorEvent is a keyboard e…
Browse files Browse the repository at this point in the history
…vent
  • Loading branch information
clauderic committed Jun 4, 2024
1 parent 5d57464 commit f848f47
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
File renamed without changes.
5 changes: 5 additions & 0 deletions .changeset/restore-focus-keyboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dnd-kit/dom': patch
---

- Only restore focus after drop if the `activatorEvent` is a keyboard event.
2 changes: 1 addition & 1 deletion packages/dom/src/core/plugins/feedback/Feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class Feedback extends Plugin<DragDropManager> {
const id = manager.dragOperation.source?.id;

const restoreFocus = () => {
if (id == null) {
if (!isKeyboardOperation || id == null) {
return;
}

Expand Down

0 comments on commit f848f47

Please sign in to comment.