Questions tagged [event-capturing]
51 questions
60
votes
1 answer
Example for Bubbling and Capturing in React.js
I am looking for an example in handling Bubbling and Capturing in React.js. I found one with JavaScript, but I am having trouble finding the equivalent for React.js.
How would I have to create an example for Bubbling and Capturing in React.js?

Socrates
- 8,724
- 25
- 66
- 113
18
votes
1 answer
Real world example where event capturing is necessary / preferred?
The addEventListener DOM method supports a third optional, boolean parameter (useCapture) to indicate whether the function should use event bubbling or event capturing as propagation method. In this article the difference is nicely shown (click on…

webketje
- 10,376
- 3
- 25
- 54
14
votes
2 answers
Event Capturing, Event Bubbling and jQuery.on()
I have an interesting question about event capturing, bubbling and jQuery.on().
I have recently learned more about the difference between event capturing and event bubbling and how the two flow differently in and out of the child-parent elements…

Methedex
- 175
- 1
- 8
10
votes
1 answer
Bubbling and capturing with addEventListener
I recently discovered the difference between Bubbling and Capturing on DOM events, using javascript. Now I understand how it's supposed to work, but I've found a weird situation and I would like to know why is that happening.
According to Quirks…

Noel De Martin
- 2,779
- 4
- 28
- 39
8
votes
2 answers
Examples of common, practical uses of event bubbling and capturing?
Can someone provide practical, everyday examples of event bubbling and event capturing in jQuery/javascript? I see all kinds of examples demonstrating these concepts but they always seem like things you'd never actually need in a regular web…

tim peterson
- 23,653
- 59
- 177
- 299
6
votes
2 answers
OnDrop Event Target is children when dropped over children, even when Capture phase is used
I'm trying to make my Drag and Drop work properly in JavaScript without having to explicitly scan for the parent element nor other ID, class loops and other hacky magic.
Right now when I drag one of the elements in the element pool and drag it to…

Robert Koszewski
- 583
- 1
- 8
- 17
5
votes
1 answer
How to capture button click event of webpage (opened inside WebBrowser Control) in WPF form?
Consider a scenario where I have a WebBrowser Control in WPF application.
A web page is loaded inside WebBrowser Control. The web page contains a button.
The web page is of ASP.NET application.
I want to capture the button click event of the webpage…

Tapan
- 108
- 1
- 7
5
votes
1 answer
Create a hole in react-native webview for touch events
We are trying to repeat the same thing that was done is this plugin: https://github.com/mapsplugin/cordova-plugin-googlemaps/blob/master/README.md (How does this plugin work) but using react-native + mapbox gl(native).
The idea is simple: webview…

XzKto
- 2,472
- 18
- 18
4
votes
3 answers
Trying to simulate label click
Why doesn't this work? The label is inside the .item parent. I don't want to put it outside of block elements as it wouldn't be valid.
So I'm trying to simulate a label click:
$(".item").click(function(){
…

domino
- 7,271
- 12
- 36
- 48
3
votes
0 answers
Will react "capture" event handlers always trigger before native non-capture handlers?
In this Discuss thread, Sophie Alpert says this about event handling in React:
We don't guarantee anything about event ordering between React events and native events.
However, I'm curious if it's safe to assume that React "capture" events, such…

Jordan Eldredge
- 1,587
- 1
- 19
- 25
3
votes
1 answer
Event capturing phase is not working as expected on html element which don't have children nodes
Lets consider following html
Outer Tag
Applying events
var outer = document.getElementById('outer'),
inner =…Inner Tag

Yogesh Jagdale
- 721
- 9
- 21
3
votes
1 answer
Binding jQuery handlers during the event capture phase (not event bubbling)
I'm looking to implement event delegation on blur/focus events, in a similar way to that suggested on quirksmode. As explained in TFA, blur and focus events don't bubble, so you can't use event delegation with them in the bubbling phase, but you…

El Yobo
- 14,823
- 5
- 60
- 78
2
votes
1 answer
Clicking a child component affects parent in an unexpected way
I have two components, Container and Item.
Container contains Item.
Item contains a button and a div.
These components have the following behaviors:
Container: When I click outside of Container it should disappear, I'm achieving this by using a…

GhostOrder
- 586
- 7
- 21
2
votes
1 answer
Bubbling and Capturing events order at target
Is Bubbling and Capturing events order during Target phase defined anywhere?
Pretty much anywhere you look, you will find that first there is Capturing phase, then Bubbling phase. Some sources additionally mention Target phase as a separate…

Dewke
- 63
- 4
2
votes
2 answers
Get id of elem changed when event is attached to document
Points to be noted:
The whole document is content editable
The body has an input event attached to it
I need to get the id of the specific element which was changed
Only vanilla Javascript is allowed
e.g : If I change Tom to Paul, I should get m1…

TechXpert
- 155
- 2
- 3
- 10