Ticket #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: | ||
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.
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
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: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
Note: See
TracTickets for help on using
tickets.
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.