Open darrenklein opened 3 years ago
Team, Do we have any plan to add canceled
event part of draw lib itself?.
I came across this issue today and provided a fix in the app to handle it.
I also need to handle draw:canceled. Could we add this, please?
I've skipped the template because I'm not reporting a bug, exactly, just a (hopefully) helpful tip. I needed specific behavior when a user canceled drawing via clicking the "Escape" key, which triggers the
"draw:canceled"
event. I expected to find that event listed among the events in https://github.com/Leaflet/Leaflet.draw/blob/develop/src/Leaflet.Draw.Event.js, however it wasn't included there. That module is really helpful, and I used a few other events there for other purposes (such asL.Draw.Event.DRAWSTOP
, but there is noL.Draw.Event.DRAWCANCELED
... so if you need to listen for the canceled event, try this:I'd open a PR to add that event to the https://github.com/Leaflet/Leaflet.draw/blob/develop/src/Leaflet.Draw.Event.js, but it appears that this repo is no longer being maintained.