Side navigation
#6712 closed enhancement (worksforme)
Opened June 23, 2010 03:26PM UTC
Closed October 31, 2010 09:11AM UTC
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: |
Description
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"?).
Attachments (0)
Change History (1)
Changed October 31, 2010 09:11AM UTC by comment:1
priority: | → undecided |
---|---|
resolution: | → worksforme |
status: | new → closed |
This should work properly now. Please reopen this ticket with a test case on jsFiddle if this is not the case.