Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#7968 closed bug (invalid)

Can't specify false as .bind() eventData parameter

Reported by: frizz Owned by:
Priority: low Milestone: 1.next
Component: event Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:


The false gets picked up as the new return false handler shortcut and the handler parameter is ignored.

Super-simple example here. Should open alert, but doesn't. Works in jQuery 1.4.2.

Change History (2)

comment:1 Changed 12 years ago by jitter

Component: unfiledevent
Priority: undecidedlow
Resolution: invalid
Status: newclosed

Thanks for taking the time to contribute to the jQuery project by writing a bug report and providing a test case!

This is no bug in jQuery but a misunderstanding on how the eventData parameter can be used. The bind() documentation says:

eventData A map of data that will be passed to the event handler.

From this it should become apparent that the eventData parameter needs to be a map of data and thus can not be a primitive value like false. This live test case shows a usage of the eventData parameter which follows the documentation and works as expected.

Last edited 12 years ago by jitter (previous) (diff)

comment:2 Changed 12 years ago by frizz

Thanks for the correction. Looks like I've been using bind() incorrectly for a while now, and it only became a problem after I upgraded from 1.3.2.

Note: See TracTickets for help on using tickets.