Bug Tracker

Opened 7 years ago

Closed 7 years ago

#11815 closed bug (invalid)

event.stopPropagation() prevents different namespaced events from executing (?)

Reported by: limpakos@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:


Not sure if this should be the expected behavior, or if my mind plays tricks on me, but here goes:

http://jsfiddle.net/B2t4f/1/ in the above example, two listeners are binded using "on" on the document element, both listening to focusin event, but using different namespaces. The above example makes use of event delegation. Problem: If a user focuses in the input, the "focusin" event is handled by both listeners. The ".tada" listener right after printing something in the textarea, asigns a listener with the same event.namespace on that element, in order to stop propagation of the event for that specific element to the document element {and effectively "turn the document's .tada listener off for that element"}. The .other listener should still be in effect, but instead is blocked as well. It seems that event.stopPropagation() blocks the whole focusin event, and not just the focusin.tada event, which would be expected. To reproduce that, focus between the input and textarea. Expected behavior: write in the textarea ".tada.other.other.other ..." while switching focuses between them. Currently: writes in the textarea ".tada.other" and both listeners are prevented from running again.

The expected behavior should be something like what happens here: http://jsfiddle.net/B2t4f/2/ where the listeners have been changed with plain focusin and focusout ones. {here, focusin gets "blocked" while focusout runs nonstop. Same should occur with namespaces (?)}

Change History (1)

comment:1 Changed 7 years ago by dmethvin

Resolution: invalid
Status: newclosed

Namespaces don't affect propagation. Ask for help on the forum.

Note: See TracTickets for help on using tickets.