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: allow calling release without argument #572

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lddubeau
Copy link

Calling release({}) used to be okay. The code of release would try to grab clientX/Y from the empty object, get undefined for both coordinate, and feed them to elementFromPoint. elementFromPoint was fine with that and just returned null. However a recent Chrome change broke this. Chrome now checks that the coordinates passed to elementFromPoint are finite doubles and so passing undefined no longer works.

This commit makes it so that calling release without an event object works. It will just skip trying to find a drop target.

As I was submitting this PR, I noticed another PR for the same issue. However, I disagree with the solution provided there. Calling release with clientX and clientY arbitrarily set to -1 is not safe as the coordinates -1, -1 can be pointing to a legitimate element for some use-case scenarios. Rare? Yes, but it can happen.

Calling `release({})` used to be okay. The code of `release` would try
to grab `clientX/Y` from the empty object, get `undefined` for both
coordinate, and feed them to `elementFromPoint`. `elementFromPoint`
was fine with that and just returned `null`. However a recent Chrome
change broke this. Chrome now checks that the coordinates passed to
`elementFromPoint` are finite doubles and so passing `undefined` no
longer works.

This commit makes it so that calling release without an event object
works. It will just skip trying to find a drop target.
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