Skip to content

fix(dnd): dispatch focusin on cancel to fix keyboard nav with no drop targets#9502

Merged
reidbarber merged 2 commits intomainfrom
dnd-dispatch-focusin
Jan 26, 2026
Merged

fix(dnd): dispatch focusin on cancel to fix keyboard nav with no drop targets#9502
reidbarber merged 2 commits intomainfrom
dnd-dispatch-focusin

Conversation

@reidbarber
Copy link
Member

@reidbarber reidbarber commented Jan 16, 2026

Closes #9495

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Test new story:

  1. Focus on an item's drag button
  2. Press Enter to start keyboard drag
  3. Notice there are no valid drop targets (shouldAcceptItemDrop rejects all item drops)
  4. Press Escape to cancel the drag
  5. Try pressing arrow keys
  6. Observe that focus moves (and we've exited virtual drag mode)

🧢 Your Project:

@rspbot
Copy link

rspbot commented Jan 16, 2026

@reidbarber reidbarber enabled auto-merge January 26, 2026 18:32
@reidbarber reidbarber added this pull request to the merge queue Jan 26, 2026
Merged via the queue into main with commit 9c0c82a Jan 26, 2026
33 checks passed
@reidbarber reidbarber deleted the dnd-dispatch-focusin branch January 26, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Arrow keys stop working after a keyboard drag when shouldAcceptItemDrop rejects all drop targets

5 participants