Skip to main content

Bug Tracker

Side navigation

#10005 closed bug (duplicate)

Opened August 08, 2011 10:41PM UTC

Closed November 18, 2011 03:15PM UTC

Last modified November 18, 2011 03:15PM UTC

Click event function does not fire at consistent times.

Reported by: k4emic@gmail.com Owned by:
Priority: low Milestone:
Component: event Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:
Description

If using .click() on a checkbox element, the returned value from .is('checked') from inside the elements .click() function will return the opposite of the actual state. If you click the checkbox, the .is('checked') will return the correct state.

[ Example fiddle]

This issue has been around for a while, [ this blog entry] is from 2009.

Callbacks attached to .change() works consistently.

Attachments (0)
Change History (9)

Changed August 08, 2011 10:45PM UTC by anonymous comment:1

This bug is reproducible on Firefox 5.0 and Google Chrome 13.0.782.107 m on windows 7 64 bit with jQuery 1.3.2, 1.4.4, 1.5.2 and 1.6.2.

Changed August 09, 2011 01:21AM UTC by rwaldron comment:2

component: unfiledevent
milestone: None1.6.3
priority: undecidedlow
resolution: → worksforme
status: newclosed
Callbacks attached to .change() works consistently.

Changed August 09, 2011 11:40AM UTC by k4emic@gmail.com comment:3

Was this report closed because another function works as intended, while this one doesn't?

If so, this problem should be mentioned on the documentation page for click (since comments are closed).

Changed August 09, 2011 12:10PM UTC by rwaldron comment:4

description: If using .click() on a checkbox element, the returned value from .is('checked') from inside the elements .click() function will return the opposite of the actual state. If you click the checkbox, the .is('checked') will return the correct state. \ \ [http://jsfiddle.net/k4emic/6xufL/1/ Example fiddle] \ \ This issue has been around for a while, [http://www.bennadel.com/blog/1525-jQuery-s-Event-Triggering-Order-Of-Default-Behavior-And-triggerHandler-.htm this blog entry] is from 2009. \ \ Callbacks attached to .change() works consistently.If using .click() on a checkbox element, the returned value from .is('checked') from inside the elements .click() function will return the opposite of the actual state. If you click the checkbox, the .is('checked') will return the correct state. \ \ [ Example fiddle] \ \ This issue has been around for a while, [ this blog entry] is from 2009. \ \ Callbacks attached to .change() works consistently.

You're missing the point - click is the wrong event to use with checkboxes. It's like reporting that mousedown doesn't work when you hit the spacebar on your keyboard

Changed August 25, 2011 12:14PM UTC by anonymous comment:5

This but was introduced in jquery-1.4.1. On jquery-1.4 click method works fine.

Changed August 26, 2011 01:57AM UTC by dmethvin comment:6

milestone: 1.6.3

Changed November 18, 2011 03:15PM UTC by dmethvin comment:7

resolution: worksforme
status: closedreopened

Changed November 18, 2011 03:15PM UTC by dmethvin comment:8

resolution: → duplicate
status: reopenedclosed

Changed November 18, 2011 03:15PM UTC by dmethvin comment:9

Duplicate of #3827.