Bug Tracker

Ticket #13997 (closed bug: fixed)

Opened 18 months ago

Last modified 7 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 18 months ago by dmethvin

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

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 15 months ago by dmethvin

  • Milestone changed from 1.10.2/2.0.3 to 1.next

comment:3 Changed 15 months ago by m_gol

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

comment:4 Changed 15 months ago by m_gol

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

comment:5 Changed 9 months ago by dmethvin

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

comment:6 Changed 9 months ago by Dave Methvin

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

Event: Call underlying stopImmediatePropagation when present

Fixes #13997

Changeset: 6a89db86ed817f6a7498076e2a06b90f9fce0831

comment:7 Changed 7 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.