Bug Tracker

Modify

Ticket #6712 (closed enhancement: worksforme)

Opened 3 years ago

Last modified 3 years ago

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

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"?).

Change History

comment:1 Changed 3 years ago by snover

  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to worksforme

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.