Migrated from: Leaflet#9934
Original author: danallsop
Original created: 2025-10-07T22:20:02Z
So what I am confused about is why we are passing things that are not Event to this function in the first place. The test failures in Leaflet#9894 (comment) seem to indicate a larger issue that raises questions for me:
- Should we have been calling
.preventDefault() on originalEvent if present? (e.g. we do have some special handling for stopping events
- Why does this
originalEvent even exist in the first place? Could we possibly get rid of it?
- Is it even the responsibility of
DomUtil.preventDefault() to check for the existence of preventDefault(), or should it have never been called in the first place? (perhaps this should have been handled in DomEvent.stop()?)
danallsop/core danallsop/leaflet-maintainers any insights into this?
Either way, I am approving this PR as this discussion is out of scope for what is being delivered here, so feel free to merge. I would still like to get some answers.
Originally posted by danallsop in Leaflet#9894 (comment)
So what I am confused about is why we are passing things that are not
Eventto this function in the first place. The test failures in Leaflet#9894 (comment) seem to indicate a larger issue that raises questions for me:.preventDefault()onoriginalEventif present? (e.g. we do have some special handling for stopping eventsoriginalEventeven exist in the first place? Could we possibly get rid of it?DomUtil.preventDefault()to check for the existence ofpreventDefault(), or should it have never been called in the first place? (perhaps this should have been handled inDomEvent.stop()?)danallsop/core danallsop/leaflet-maintainers any insights into this?
Either way, I am approving this PR as this discussion is out of scope for what is being delivered here, so feel free to merge. I would still like to get some answers.
Originally posted by danallsop in Leaflet#9894 (comment)