All Questions

2515
votes
9answers
700017 views

event.preventDefault() vs. return false

When I want to prevent other event handlers from executing after a certain event is fired, I can use one of two techniques. I'll use jQuery in the examples, but this applies to plain-JS as well: 1. e...
213
votes
14answers
187631 views

How do I prevent a parent's onclick event from firing when a child anchor is clicked?

I'm currently using jQuery to make a div clickable and in this div I also have anchors. The problem I'm running into is that when I click on an anchor both click events are firing (for the div and the...
167
votes
28answers
96244 views

Prevent scrolling of parent element?

I have a little "floating tool box" - a div with position:fixed; overflow:auto. Works just fine. But when scrolling inside that box (with the mouse wheel) and reaching the bottom OR top, the parent e...
107
votes
9answers
71917 views

Stop mouse event propagation in Angular

What is the easiest way to stop mouse events propagation in Angular 2? Should I pass special $event object and call stopPropagation() myself or there is some other way. For example in Meteor I can sim...
10
votes
2answers
17495 views

Event propagation in Javascript

If I have an element (html) nested in another element and both of them have a click handler attached, clicking the inner element executes its click handler and then bubbles up to the parent and execut...
14
votes
1answers
46533 views

Javascript : How to enable stopPropagation?

With object.stopPropagation() I can stop event bubbling but how can I re-enable it? Is there a pre defined function in js something like object.startPropagation? EDIT: The Problem is that the JS re...
10
votes
3answers
16236 views

Event Bubbling, and Stop Propagation

What is the difference between event.bubbles to false for any event, and setting event.stopPropagation() or stopImmediatePropagation() while handling event? I'm using Flex4 with AS3.
46
votes
6answers
43941 views

How to continue event propagation after cancelling?

When a user clicks a certain link I would like to present them with a confirmation dialog. If they click "Yes" I would like to continue the original navigation. One catch: my confirmation dialog is im...
17
votes
2answers
13169 views

React prevent event bubbling in nested components on click

Here's a basic component. Both the <ul> and <li> have onClick functions. I want only the onClick on the <li> to fire, not the <ul>. How can I achieve this? I've played around ...
14
votes
2answers
8637 views

Google Map's Double Click Event Propagation

This question is asked often, but never really answered well. Let's see if we can remedy it! Event Propagation Google allows you to bind to events in a Google Map View via their API using event ...

Previous Next