Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse events are not firing when drawing #1031

Open
artuska opened this issue Nov 17, 2021 · 1 comment
Open

Mouse events are not firing when drawing #1031

artuska opened this issue Nov 17, 2021 · 1 comment

Comments

@artuska
Copy link

artuska commented Nov 17, 2021

When i create some drawing shape i subscribe to the mouse events and then start drawing:

let drawingShape = new Leaflet.Draw.Rectangle(map, drawingOptions)

map.on('mousedown', handleDrawingMouseDownEvent);
map.on('mousemove', handleDrawingMouseMoveEvent);

drawingShape.enable();

But when i press-and-hold the mouse and then move my mouse to draw a rectangle none of mousedown or mousemove events are firing.

So, it seems when the drawing starts all mouse events are defaultPrevented and stopPropagated and not firing to the map.

What should i do to catch all those mouse events?

I need mousedown event to know Rectangle's starting point coordinates and mousemove event to know the last point of the Rectangle while drawing.

@artuska artuska changed the title Mouse events not firing when drawing Mouse events are not firing when drawing Nov 17, 2021
@mithi-datature
Copy link

I'm having the same issue.

Let me know if you found a workaround @artuska

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants