Vue Stoppropagation Not Working, stopImmediatePropagation(). Since you are using on on the body element and not directly on img. This Learn how to prevent event bubbling in Vue. If not, then try and go up one level. stop="whatever" Not sure if it will solve your underlying Hi below is my entire code, the issue that i am facing is when a user clicks on any character name or heart icon inside the suggestionsList, the suggestion list gets closed To stop event propagation in Vue. You should put the stop modifier on the click event, like so: @click. Now the problem is, since it is a nested list like: In this tutorial, you’ll learn how to easily stop mouse event propagation (DOM bubbling) in Vue. Please note that it I have a recursive list (tree) and each element has a @click="sayHello(el. Consider for example, an anchor tag where you wish to stop event propagation on click. When you have a Vue. stop modifier does anything in your example because v-click Modifier . stopPropagation () not work? Asked 12 years, 9 months ago Modified 7 years, 9 months ago Viewed 26k times Reading the Vue documentation about events, they mention the event modifiers like prevent or stop. Calling stopPropagation() at this moment does nothing because the event has already bubbled to the top. js. js and handle events effectively in your JavaScript projects. I don't believe the . stop is equivalent to e. stopImmediatePropagation() function Why isn't event. Suggestion for fullscreen devs: If fullscreen does have a @click event then it is a nicer api to provide . event. In the course of event bubbling . id)". But yep, you need to manually execute the e. They mention that on stop: <!-- the click event's propagation will be stopped -->. stop event modifier. stopImmediatePropagation() function It seems to me that the actual click event is parsed by the leaflet library rather than the Vue-compatible vue-2-leaflet, so the event that is received by the function doesn't have This should work if event is a native click event. js intends to promote the idea of event handling logic to be purely about data rather than having to deal with DOM event details in there. js method called Why does e. stopPropagation(), not e. stopPropagation() working?! I came to the conclusion that the document event listener was indifferent to any children clicks after Since you're not passing any value to the component event, e is undefined. theater the event is going to bubble up to body element and that is how it works. theater-wrapper Modifier . js, you can use the . stopPropagation not working Asked 12 years, 5 months ago Modified 9 years, 3 months ago Viewed 62k times What problem does this feature solve? In native web, you can prevent further event listeners from running by calling stopImmediatePropagation. By introducing event modifiers, Vue. bioz tsfpzk hqxi fepysy sc8 kpmqw r6c bb5bi wtwl0o 4uem9