Unable to cancel Rectangle and Circle drawing in Chrome w/Touch
See original GitHub issue- I’m reporting a bug, not asking for help
- I’ve looked at the documentation to make sure the behaviour is documented and expected
- I’m sure this is a Leaflet Draw code issue, not an issue with my own code nor with the framework I’m using (Cordova, Ionic, Angular, React…)
- I’ve searched through the issues to make sure it’s not yet reported
How to reproduce
- Leaflet version I’m using:
1.4
- Leaflet Draw version I’m using:
1.0.4
- Browser (with version) I’m using:
Chrome Version 73.0.3683.103
- OS/Platform (with version) I’m using:
Windows 10 32-bit
Actually I suffer from this issue on android, but it’s easy to reproduce it on Chrome on desktop.
- Open Chrome DevTools <kbd>Ctrl-Shift-I</kbd> and enter mobile mode <kbd>Ctrl-Shift-M</kbd>
- Press Rectangle creating button.
What behaviour I’m expecting and which behaviour I’m seeing
It’s now impossible to exit drawing mode, because neither toolbar nor tooltip are clickable. We can exit only finishing rectangle. There are also issues with multiple taps. Circle has the same issue
I found another mobile-related issue here: #789
Minimal example reproducing the issue
Official sample is enough: https://leaflet.github.io/Leaflet.draw/docs/examples/full.html
Issue Analytics
- State:
- Created 4 years ago
- Comments:14
Top Results From Across the Web
Bug: Rectangle drawing on Chrome [35823894] - Issue Tracker
Drawing a rectangle using the DrawingManager no longer works on Chrome. To reproduce the problem: Click on the rectangle icon and try to...
Read more >Add a shape - Google Web Designer Help
The shape tools let you draw basic geometric shapes—ovals, rectangles, and lines—on the ... Oval - Press Shift + drag to constrain the...
Read more >I can't change tools.. Please help! :( - Adobe Support Community
If you want change the other tools, you have to click the Rectangle tool(current selected tool) over 1 second. then you will find...
Read more >Why can't I find shape tool on google web designer
There is only pen tools, and it cannot be used for drawing any standard shapes.I am using the 1.5.1.1118 beta edition, which should...
Read more >walmart small wall mirrors
Framed 20 x 30 Rectangular Wall Mirror, Matte Black Finish by Varaluz Casa ... Sale Hexagon Mirrors Adhesive Wall Art 4 stars out...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found a solution. The line 1260 of the leaflet.draw 1.0.4 contains the following code:
document.addEventListener('touchstart', L.DomEvent.preventDefault, { passive: false });
I replaced that line with
var tempMap = document.getElementById("map");
tempMap.addEventListener('touchstart', L.DomEvent.preventDefault, { passive: false });
Basically instead of preventing the touchstart event on the document, now is applied only to the map object.
This problem still existed with Leaflet 1.7.1. We can not press the cancel button when drawing a circle. But we can press the cancel button when drawing a polygon when using mobile android.