Fix popup panel not opening from the data browser

The issue was:
- clicking on feature in the data browser replaces the panel content
- then the clicked link (the feature name or the little glass icon) is removed
- thus it is detached from the DOM
- and specially from its parent on which disableClickPropagation was called
- so Leaflet fails to prevent click propagation
- so the map received the click, and thus it call the onRemove method on
  the panel, as expected (clicking on the map always close the current
  open popup, if any)

This could be removed when this is released:

https://github.com/Leaflet/Leaflet/pull/9052
This commit is contained in:
Yohan Boniface 2023-07-31 20:59:09 +02:00
parent 50b8b66261
commit 3115038ba6

View file

@ -671,6 +671,9 @@ L.U.DataLayer.addInitHook(function () {
L.U.Map.include({ L.U.Map.include({
_openBrowser: function () { _openBrowser: function () {
const browserContainer = L.DomUtil.create('div', 'umap-browse-data') const browserContainer = L.DomUtil.create('div', 'umap-browse-data')
// HOTFIX. Remove when this is merged and released:
// https://github.com/Leaflet/Leaflet/pull/9052
L.DomEvent.disableClickPropagation(browserContainer)
const title = L.DomUtil.add( const title = L.DomUtil.add(
'h3', 'h3',