Bug Tracker

Opened 13 years ago

Closed 12 years ago

#6712 closed enhancement (worksforme)

Using return false to cancel 'bubbling' in live() handlers also prevents default

Reported by: Phrogz Owned by:
Priority: undecided Milestone: 1.4.3
Component: event Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:


As noted on the documentation for .live(), evt.stopPropagation() does not do what one might hope. Instead, one must use "return false" to prevent further handling of an event.

However, this also prevents the event from performing its default action. For a pared-down test case of a real-world example, see: http://phrogz.net/tmp/livebubble.html

Without using .live(), the pair of handlers and stopPropagation() work well together. With .live(), however (needed when items on that page are dynamically added), there is no way to both prevent the 'bubbling' and also allow mouse-based focusing of form fields.

.live() should not use return false as the sigil to prevent bubbling. It should use another sigil (return true? return "no-live-bubbling"?).

Change History (1)

comment:1 Changed 12 years ago by snover

Priority: undecided
Resolution: worksforme
Status: newclosed

This should work properly now. Please reopen this ticket with a test case on jsFiddle if this is not the case.

Note: See TracTickets for help on using tickets.