Bug Tracker

Opened 3 years ago

Closed 2 years ago

Last modified 22 months 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 3 years ago by dmethvin

  • Component changed from unfiled to event
  • Milestone changed from None to 1.10.2/2.0.3
  • Priority changed from undecided to low
  • Status changed from new to open

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 2 years ago by dmethvin

  • Milestone changed from 1.10.2/2.0.3 to 1.next

comment:3 Changed 2 years ago by m_gol

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

comment:4 Changed 2 years ago by m_gol

  • Milestone changed from 1.next to 1.next/2.next

comment:5 Changed 2 years ago by dmethvin

  • Milestone changed from 1.next/2.next to 1.11.1/2.1.1
  • Owner set to dmethvin
  • Status changed from open to assigned

comment:6 Changed 2 years ago by Dave Methvin

  • Resolution set to fixed
  • Status changed from assigned to closed

Event: Call underlying stopImmediatePropagation when present

Fixes #13997

Changeset: 6a89db86ed817f6a7498076e2a06b90f9fce0831

comment:7 Changed 22 months ago by dmethvin

  • Summary changed from stopImmediatePropagation doesn't stop DOM added event listenders to stopImmediatePropagation doesn't stop DOM added event listeners
Note: See TracTickets for help on using tickets.