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

Unexpected behavior for drag between line #417

Closed
julianpoy opened this issue Nov 3, 2024 · 5 comments
Closed

Unexpected behavior for drag between line #417

julianpoy opened this issue Nov 3, 2024 · 5 comments
Assignees

Comments

@julianpoy
Copy link

Describe the bug
The drag line doesn't disappear if the user's cursor leaves the dragline area.

To Reproduce
https://rct.lukasbach.com/docs/guides/drag-and-drop#only-reordering-of-items-allowed
Can be reproduced here.

  1. Drag an item
  2. Move your cursor between items to display the drag between line
  3. Move your cursor horizontally outside of the tree and see that the drag between line is still shown, even though dropping won't result in the item actually going there

You can also reproduce this (more significantly) when moving the cursor to the top or bottom of the tree, and then outside.

Expected behavior
The drag between line should only appear if the user's cursor is in a valid position to drop between items.

@julianpoy
Copy link
Author

It looks like the same behavior can occur with dragging over items, not just the drag between line.

@doulighan
Copy link

+1, I feel removing the drag line is a better indicator to the user that a drop will fail, rather than adjusting the dataTransfer.dropEffect cursor icon. However I don't see an easy way to accomplish this, I think the InteractionManager would need to communicate with the tree.

@julianpoy
Copy link
Author

Adding to this, if I drag an element over another element and then decide I don't want to actually drop it there, the element I was dragging over remains selected as the place to drop.

2024-11-11.11-47-17.mp4

This is particularly undesirable.

lukasbach added a commit that referenced this issue Nov 18, 2024
* fix: improve drag behavior outside of tree boundaries or legal drop positions (#417)

* chore: use volta in core package for react workflow

* chore: fix packagejson field

* chore: change verify workflow to not use yarn on nested packages
@lukasbach
Copy link
Owner

Hi, thanks for the report! I pushed a new release 2.4.6 which hopefully solves the issues you described. Let me know if that worked for you.

@julianpoy
Copy link
Author

Hi @lukasbach looks great - I've been testing for several days now and can confirm all of the issues seem to be resolved. Thank you!

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

No branches or pull requests

3 participants