Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: drag & drop defaultId & disabled behavior #7812

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nwidynski
Copy link
Contributor

Closes #7379 (comment)

Following up on the discoveries made in #7379, this PR forwards collection components id into dnd hooks. It also fixes keyboard issues found in testing where reordering would get stuck because of disabled keys at the boundaries of the collection.

As a more general note, I feel like keyboard navigation of the <DragIndicator /> could be improved significantly, especially in terms of communicating the visual position. Often times it behaves very unexpected at row boundaries or when encountering disabled items (e.g. displayed on the previous row while actually on next row "before").

I'm not sure whether you guys have this on the roadmap already but otherwise I will see whether I can tackle that in another PR follow-up 👍

✅ 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:

🧢 Your Project:

@nwidynski nwidynski marked this pull request as draft February 24, 2025 09:15
@nwidynski
Copy link
Contributor Author

nwidynski commented Feb 24, 2025

Unfortunately the draft will misbehave in grid layouts because the next collection key isn't the target key to move to.

I'm still debating whether introducing a "shouldSkip" argument to each delegate method is the proper way forward and whether we could merge findNextNonDisabled and findKey into one helper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant