Bug Tracker


Ticket #7883 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

.delegate (and .live) should accept false as the fn arg, like .bind

Reported by: cowboy Owned by: rwaldron
Priority: high Milestone: 1.6
Component: event Version: 1.4.4
Keywords: Cc:
Blocking: Blocked by:


Just like .bind, .delegate (and .live) should accept false as a shortcut for function(){return false;}.

That way, someone could just do something like this to stop the original .live selector from matching just the "a" elements, instead of having to write a huge, complicated  patch. :P

$('a,form').live( 'click', fn ); // pre-existing code

$('body').delegate( 'a', 'click', false ); // their code

Change History

comment:1 Changed 3 years ago by addyosmani


comment:2 Changed 3 years ago by rwaldron

  • Owner set to rwaldron
  • Priority changed from undecided to low
  • Status changed from new to assigned
  • Component changed from unfiled to event

comment:3 Changed 3 years ago by rwaldron

  • Priority changed from low to high

I'm changing this to "high" to ensure that it's added in 1.6 - simply for the sake of consistency... amirite?

comment:4 Changed 3 years ago by dmethvin

  • Status changed from assigned to closed
  • Resolution set to fixed

Landed pull 159.

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


Add a comment

Modify Ticket

as closed

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

Note: See TracTickets for help on using tickets.