Leaflet / Leaflet.draw

Vector drawing and editing plugin for Leaflet
https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html
MIT License
1.98k stars 996 forks source link

Edge - using openPopup() after adding layer from draw:created event doesn't work #819

Open emmalivingstone opened 6 years ago

emmalivingstone commented 6 years ago

How to reproduce

What behaviour I'm expecting and which behaviour I'm seeing

Since openPopup() is called after a new layer is created, I expect to see a popup come up.

This works on Chrome and Firefox, and also for lines and markers in Edge. But for rectangles, polygons and circles the popup doesn't appear. For polygons you can see the popup flicker up then immediately get closed.

Minimal example reproducing the issue

Here's an example jsfiddle

dh-shin commented 5 years ago

In my case, I set the option 'closeOnClick' to false, and it worked.

e.layer.bindPopup('Hello', { closeOnClick: false });