As of v4.3.0, clicks inside of Popups uncontrollably propagate up to the Map component.
react-mapbox-gl version: 4.3.0 and above
mapbox-gl-js version: 0.5.4
browser: Chrome, latest
event.stopPropagation() to the Popup's click handlerI expect one of two things--for the popup to capture the context of the click by default (controlled by parameter, perhaps), and/or to easily and programmatically stop the click event from bubbling up to the map.
Neither of the above seem to be the case. Clicking inside a popup fires a map click event and there's no way to prevent it.
I'm experiencing the exact same thing with mapbox-gl 0.54.0 and react-mapbox-gl 4.4.0. Will look to downgrade to 4.2.4 until this is resolved.
I know it's a crappy workaround but you could use onMouseUp instead of onClick while this bug (or feature?) isn't solved.
Otherwise you could implement a check if the click on the map was a click on the popup.
The same thing happens with onMouseUp, so that doesn't really help
Fixed in v4.5.0 by reverting back the default behaviour.
For cross-referencing, this is a dupe of #725
Most helpful comment
I'm experiencing the exact same thing with mapbox-gl
0.54.0and react-mapbox-gl4.4.0. Will look to downgrade to 4.2.4 until this is resolved.