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 isOver on nested drop targets (fix #13) #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

qtsd
Copy link

@qtsd qtsd commented Jun 21, 2019

Current behavior :
- find all the drop targets that are under the mouse

Fixed behavior :
- take the first element under the mouse
- find any drop targets that are either this element or one of its parents
- sort them by their position in the DOM (from deep to shallow)

Here is a codesandbox to see the different behavior between html5 and mouse backends (to change the backend, see index.js).

@qtsd qtsd changed the title fix isOver on nested drop targets (fix zyzo#13) fix isOver on nested drop targets (fix #13) Jun 21, 2019
@qtsd
Copy link
Author

qtsd commented Jun 25, 2019

I realize this technique can have a flaw.
If you use a drag layer, it must have pointer-events: none, so the drop targets behind can be triggered normally.
Therefore it can be tricky to change the mouse cursor since with pointer-events: none, the cursor css rule is ignored.

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