Code Monkey home page Code Monkey logo

Comments (6)

liamb13 avatar liamb13 commented on May 27, 2024

Does @click.stop work for you?

from v-mapbox.

jasonhibbs avatar jasonhibbs commented on May 27, 2024

Does @click.stop work for you?

It would likely work on the second MouseEvent, but throws an error on the emitted MapMouseEvent because this doesn’t implement stopPropagation (which is expected)

Screenshot 2022-04-12 at 16 25 44

from v-mapbox.

jasonhibbs avatar jasonhibbs commented on May 27, 2024

From Vue docs on defineEmits:

If a native event (e.g., click) is defined in the emits option, the listener will now only listen to component-emitted click events and no longer respond to native click events.

from v-mapbox.

liamb13 avatar liamb13 commented on May 27, 2024

This won't solve the issue itself, but just trying to offer a workaround. What's the use case for the @click on v-map, and what's the secondary click used for?
Is it necessary in your use case to detect a top level click? (I'm assuming it likely is, to close a popup or similar?)

from v-mapbox.

jasonhibbs avatar jasonhibbs commented on May 27, 2024

I have a workaround:

To prevent the MouseEvent from firing, I am stopping propagation on the originalEvent

This is possible because mapbox already provides the native event as originalEvent in MapMouseEvent – if I needed the native event, I’d expect to use this.

Use case for @click is varied, but the expectation is that it would emit only the mapbox event: MapMouseEvent.

My best guess is that VMap isn’t using defineEmits which would deregister the native event and behave as expected.

from v-mapbox.

jasonhibbs avatar jasonhibbs commented on May 27, 2024

@vinayakkulkarni do you agree with my assessment?

My best guess is that VMap isn’t using defineEmits which would deregister the native event and behave as expected.

from v-mapbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.