Open hyperknot opened 6 years ago
Yea, per #495, Draw and Popup have a conflict caused by how Popup uses mouse events to close the popup. These events are controlled within gl-js and not in Draw (assuming I'm remembering things correctly).
Is this still an issue? I played around with the example and the popup worked as expected (even with the timeout uncommented).
@vivkr this is still an issue, I had to use closeOnClick:false
for popups I wanted to open after draw.create, since that way the map click that initiated the event doesn't then also immediately close it-
mapbox-gl-js version: 0.45.0 mapbox-gl-draw version: 1.0.9
Steps to Trigger Behavior
draw.create
Expected Behavior
Popup should open
Actual Behavior
Popup does not open.
Example Click somewhere on the map, try with setTimeout uncommented. https://codesandbox.io/s/6y4x0oxw9k
Is is possible that this is a duplicate of an issue from 2016? https://github.com/mapbox/mapbox-gl-draw/issues/495
What is the right solution here? Using
setTimeout
is such a hack and I cannot be sure that it'll work for everyone. Still, with setTimeout it can be made to work.