You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 18, 2018. It is now read-only.
I ran into an interesting bug today while I was writing some tests for a hover handler. The relevant code is here.
During a drag operation, for any drop target that the drag operation goes through, for the first frame of that hover incident, isOver will incorrectly return false in the hover handler. This is because that handler is called before the drop target is registered as being hovered over in the monitor's store.
In normal use this probably doesn't matter, as you'd be hovering for more than one frame. In tests, however, it's easy to trigger. With the following test code, the do_the_thing() part never happens.
What I've done for now to work around this is call simulateHover twice. What this does is triggers two calls to hover - one where the drop target is not yet registered, and one where it is.
I ran into an interesting bug today while I was writing some tests for a
hover
handler. The relevant code is here.During a drag operation, for any drop target that the drag operation goes through, for the first frame of that hover incident,
isOver
will incorrectly returnfalse
in thehover
handler. This is because that handler is called before the drop target is registered as being hovered over in the monitor's store.I have a
hover
handler that looks like this:In normal use this probably doesn't matter, as you'd be hovering for more than one frame. In tests, however, it's easy to trigger. With the following test code, the
do_the_thing()
part never happens.What I've done for now to work around this is call
simulateHover
twice. What this does is triggers two calls tohover
- one where the drop target is not yet registered, and one where it is.What a fun bug!
The text was updated successfully, but these errors were encountered: