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 994 forks source link

Editing polygon doesn't work in Firefox, only Chrome #989

Open lrustand opened 4 years ago

lrustand commented 4 years ago

How to reproduce

What behavior I'm expecting

The following two screenshots show what I expect to happen when I move a vertex: chrome_1 I click and hold mouse button on the vertex and drag it somewhere.

chrome_2 The vertex is moved to the new location, no other vertices are added or changed in any way. This is what happens in Google Chrome on all of my machines.

Which behavior I'm seeing

And this is what happens when I try the same in Firefox: firefox_1 I try to move the marked vertex.

firefox_2 Pull it out to the right. The vertex is moved correctly, but there still is a vertex in the original position.

firefox_3 Move that vertex too. This one moves correctly, but reveals yet another vertex in the original position as seen in the last screenshot.

firefox_4

Other details

The problem happens every time on Firefox. I have tried several different machines, with several different versions of Firefox on different Oses. Even tried it on Firefox Mobile.

I have also tried using Chrome on several different machines, and that works flawlessly every time.

ajmas commented 4 years ago

Do you have a version that can be looked at in codesandbox.io or equivalent? It would make it easier for others to analyse.

lrustand commented 4 years ago

Thank you for your response. I believe the problem was I didn't include all the necessary script files. A little weird that it actually works in Chrome when it was missing script files, but this seems to be what was causing it as it is working correctly in all browsers now after including all the files.

alansalinas commented 4 years ago

I am having the same problem, which script files exactly were those missing?

johnd0e commented 4 years ago

@lrustand Not sure if that is really related but this solution anyway: https://github.com/Leaflet/Leaflet.draw/issues/955#issuecomment-601190466

aqos156 commented 3 years ago

From what I found this is a problem from version 1.7.0 onwards (1.6.0 works). In 1.7.0 there was some work on browser detection and passive event detection. Also #665 is for sure related to this.

Overall it seems that Leaflet.Draw thinks it is on mobile (checkout the enlarged vertex pullies compared to "working/desktop" version). But I have not figured a way to solve this.