question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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.

  1. Open Chrome DevTools <kbd>Ctrl-Shift-I</kbd> and enter mobile mode <kbd>Ctrl-Shift-M</kbd>
  2. 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:closed
  • Created 4 years ago
  • Comments:14

github_iconTop GitHub Comments

1reaction
berniesfcommented, May 8, 2019

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.

0reactions
iisri-vucommented, May 19, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found