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 ofrelease
would try to grabclientX/Y
from the empty object, getundefined
for both coordinate, and feed them toelementFromPoint
.elementFromPoint
was fine with that and just returnednull
. However a recent Chrome change broke this. Chrome now checks that the coordinates passed toelementFromPoint
are finite doubles and so passingundefined
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
withclientX
andclientY
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.