-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Make drag handler insensitive to order of handlers events #4387
Conversation
Related: #3872 (comment) |
The more we go, the more I feel uncomfortable with having both a native event and a simulated one sent in the same time. I'm wondering then if the "proper" fix is not a bit before in the chain, trying to send either the native event or the simulated one. Also, what about making a prostetic unit test for this, do you feel it's doable and can be isolated enough without being to much coupled (given some events are simulated, if we simulate the simulation, what are we testing? :p) ? |
Wow, yeah your comment was indeed very spot on, it more or less exactly describes this issue:
As it is now, only the first touch from then touch event is passed on to the mouse event (https://github.com/Leaflet/Leaflet/blob/master/src/map/handler/Map.Tap.js#L101-103). As far as I could understand, that might be the core of at least this particular issue. How about passing along all touches in the simulated event? I think (but have not tested) this would fix this issue. What other consequences would it have, is there good reasoning behind just passing one touch? |
@perliedman any chance we can remote pair on this during the week-end so we can proceed on rc1? :) |
@yohanboniface sounds like a good idea! I think I will be able to set aside time for this on friday (15th of april). |
@yohanboniface sorry, I obviously didn't read that sentence fully :) I think I'll have a hard time scheduling time tomorrow, unfortunately :( |
@perliedman that's ok, let's plan a session on Friday then :) |
d056b45
to
5389d23
Compare
* First version of rc1 changelog (cf #4379) * fixed changelog typos, closed PR removed, contributor added * Prettify and fix minor typos in rc1 changelog * Mention #4396 in the CHANGELOG * Add mention of #4371 * Add docs updates by nathancahill * Add info on #4387 * Update date for 1.0-rc1 * Remove double PR reference for #4418
Draggable handles touch events, and does not rely on
simulated mouse events; under some circumstances, it
even breaks on simulated events (see #4315).
This PR ignores any simulated events in the event handlers,
to just deal with the real events. This makes it insensitive
to if the tap handler has run before, and fired simulated
events.
Close #4315.