Bug Tracker

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#13997 closed bug (fixed)

stopImmediatePropagation doesn't stop DOM added event listeners

Reported by: mark@… Owned by: dmethvin
Priority: low Milestone: 1.11.1/2.1.1
Component: event Version: 1.10.1
Keywords: Cc:
Blocked by: Blocking:

Description

Calling stopImmediatePropagation() will correctly stop other handlers set on the element from firing, but only those added with jQuery. Other handlers added with addEventListener() will still fire.

To stop all immediate propagation from within a jQuery event handler, one must call both:

    event.stopImmediatePropagation();
    event.originalEvent.stopImmediatePropagation();

Calling stopImmediatePropagation() on the jQuery event object should call it on the underlying DOM event object.

See: http://jsfiddle.net/fhW7n/1/

Change History (7)

comment:1 Changed 4 years ago by dmethvin

Component: unfiledevent
Milestone: None1.10.2/2.0.3
Priority: undecidedlow
Status: newopen

Yep, seems to have been that way forever. Note that there is no way to stop immediate propagation in oldIE so this will introduce a difference in behavior of non-jQuery events in oldIE vs other browsers. (Perhaps consistency is why it was there?) It doesn't affect the 2.x branch due to its browser support list but it does affect 1.x.

comment:2 Changed 4 years ago by dmethvin

Milestone: 1.10.2/2.0.31.next

comment:3 Changed 4 years ago by m_gol

We need a 1.next/2.next milestone. This is not only a 1.x issue.

comment:4 Changed 4 years ago by m_gol

Milestone: 1.next1.next/2.next

comment:5 Changed 4 years ago by dmethvin

Milestone: 1.next/2.next1.11.1/2.1.1
Owner: set to dmethvin
Status: openassigned

comment:6 Changed 4 years ago by Dave Methvin

Resolution: fixed
Status: assignedclosed

Event: Call underlying stopImmediatePropagation when present

Fixes #13997

Changeset: 6a89db86ed817f6a7498076e2a06b90f9fce0831

comment:7 Changed 3 years ago by dmethvin

Summary: stopImmediatePropagation doesn't stop DOM added event listendersstopImmediatePropagation doesn't stop DOM added event listeners
Note: See TracTickets for help on using tickets.