Skip to content

fix: Virtualized Tree DnD drop indicator #8427

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

Merged
merged 1 commit into from
Jun 20, 2025
Merged

Conversation

reidbarber
Copy link
Member

@reidbarber reidbarber commented Jun 19, 2025

Fixes drop indicators for "after" an expanded item to be after the last child (was rendering before the first child).

Previously, you would get behavior like this:

tree-dnd-broken.mov

✅ 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: https://reactspectrum.blob.core.windows.net/reactspectrum/952182bc2a0e9c8a1373918d32c48bb803c7dc8f/storybook/index.html?path=/story/react-aria-components--tree-with-drag-and-drop-virtualized&providerSwitcher-express=false

🧢 Your Project:

@rspbot
Copy link

rspbot commented Jun 19, 2025

Build successful! 🎉

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple things I noticed, but happy to get this in as is for testing:

  1. the "before" drop target for Project doesn't seem to be be visible, could be a styling issue perhaps.
  2. I'm able to have the drop target set as the collection itself upon starting a keyboard drag operation like below:
    image

This seems to be intermittent, but the easiest way I've found to reproduce it is by doing the following:

  1. Start a keyboard drag for Projects
  2. Cancel it via Escape
  3. Scroll the Tree down and back up via your touchpad/mouse wheel
  4. Start the keyboard drag again for Projects

Looks like maybe the drop indicators past the visible view aren't being persisted upon the start of the second drag?

@reidbarber reidbarber added this pull request to the merge queue Jun 20, 2025
Merged via the queue into main with commit e0a7c38 Jun 20, 2025
32 checks passed
@reidbarber reidbarber deleted the fix-virtualize-tree-dnd branch June 20, 2025 23:54
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.

4 participants