-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add an "EventData#preventInteractionHandlers" API #3290
Comments
JSBin-ified example: http://jsbin.com/mobicocaxe/edit?html,console,output |
@ntilwalli The behaviour you are seeing is due to the order in which the event listeners are run. The first time that The second time that We are looking to make the event order more stable in #2891. This fix will make all calls to What you're looking is some equivalent of As a temporary workaround, I suggest calling |
@ntilwalli Yes, your understanding is correct. We will address your use case before we merge #2891 😄 |
💭 Idea: We could add a new method to |
I think It looks like this could be implemented with cooperation between
This would address #2419, #2891, #2237 (in a cleaner way than #4528), #4297, #6047, #6132, maybe #2204, and provide a clean base for implementing a drag example that works for both mouse and touch input (#3017). |
Adding mutable state to events turns out to be much more difficult than anticipated.
|
This is based on the latest Mapbox GL JS (v0.25.1). I've posted a demo repo which has one file (index.html) which when loaded in Chrome fully replicates the issue. That file is an almost complete replica of: https://www.mapbox.com/mapbox-gl-js/example/drag-a-point/
The only differences are the places where
map.dragPan.enable()
andmap.dragPan.disable()
are called. Instead of calling those functions duringmousemove
, I call them duringmouseup
andmousedown
, but that should work fine too...Repro file at: https://github.com/ntilwalli/mapboxDragPanIssue
Steps to Trigger Behavior
Expected Behavior
Dragging circle should always work
Actual Behavior
Dragging circle only works from second attempt onwards
The text was updated successfully, but these errors were encountered: