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

@stop and @prevent not working on CircleMarker #548

Open
2 of 6 tasks
maratumba opened this issue Feb 19, 2020 · 2 comments
Open
2 of 6 tasks

@stop and @prevent not working on CircleMarker #548

maratumba opened this issue Feb 19, 2020 · 2 comments
Labels
bug confirmed Issue is accepted as either a bug or a valid enhancement help wanted

Comments

@maratumba
Copy link
Contributor

Description

Can not stop propagation or prevent default on circle marker clicks. @click.stop and/or @click.prevent throw errors. Original event seems to be in an object called $event.originalEvent but calling preventDefault() and stopPropagation() doesn't have any effect on it.

Live Demo

https://jsfiddle.net/gulyamani/541bpcja/1/

Steps to Reproduce

Open console and click circle markers.

Expected Results

Only seeing 'marker click' on console.

Actual Results

Seeing both 'marker click' and 'map click'

Browsers Affected

  • Chrome
  • Firefox
  • Edge
  • Safari 9
  • Safari 8
  • IE 11

Versions

  • Leaflet: v1.6.0
  • Vue: v2.5.16
  • Vue2Leaflet: v2.2.1
@DonNicoJs DonNicoJs added the confirmed Issue is accepted as either a bug or a valid enhancement label Feb 28, 2020
@DonNicoJs
Copy link
Member

This is a nice catch @maratumba I think we need to modify how we handle events to achieve this

@elmatou
Copy link

elmatou commented Sep 4, 2020

Hi
@DonNicoJs any reason you use DomEvent.on ti attach listeners to Leaflet object ?

As these are 'Interactive layer' we could ( and I think should, in order to solve this issue) use on from Evented class.
I noticed this while attaching different handler on Marker, Polyline and Map. I always have both handlers called (as in an event propagation) with Vue2Leaflet, and never when I a attach directly to mapObject

I would recommend to swap
DomEvent.on(this.mapObject, this.$listeners);
by
this.mapObject.on(this.$listeners);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed Issue is accepted as either a bug or a valid enhancement help wanted
Projects
None yet
Development

No branches or pull requests

3 participants