Side navigation
#8165 closed bug (fixed)
Opened February 03, 2011 04:17PM UTC
Closed January 20, 2012 03:17AM UTC
Last modified March 13, 2012 05:34PM UTC
.live('click', handler) fires on disabled buttons with child elements in Chrome
Reported by: | ms7821 | Owned by: | dmethvin |
---|---|---|---|
Priority: | high | Milestone: | 1.7.2 |
Component: | event | Version: | 1.5 |
Keywords: | Cc: | danheberden | |
Blocked by: | Blocking: |
Description
It's possible to receive events for a disabled <button> element as well as <input type="button">:
http://jsfiddle.net/Fz2F3/ (jQuery 1.4.4)
http://jsfiddle.net/Fz2F3/1/ (jQuery 1.5)
IE fires click for all of them, passing the button as the target and currentTarget. This was fixed in jQuery 1.5 in http://bugs.jquery.com/ticket/6911.
Chrome fires only for the <button> with a child element, passing that as the target. However, currentTarget is set to the button, so changing target.disabled to currentTarget.disabled should extend the fix to include Chrome.
See also the first comment on http://forum.jquery.com/topic/live-inconsistency-with-disabled-buttons.
Attachments (0)
Change History (8)
Changed February 03, 2011 04:19PM UTC by comment:1
resolution: | → duplicate |
---|---|
status: | new → closed |
Changed February 03, 2011 04:20PM UTC by comment:3
cc: | → danheberden |
---|---|
component: | unfiled → event |
milestone: | 1.next → 1.5.1 |
Changed February 03, 2011 04:24PM UTC by comment:4
priority: | undecided → high |
---|
Changed January 19, 2012 01:01AM UTC by comment:5
milestone: | 1.5.1 |
---|---|
resolution: | duplicate |
status: | closed → reopened |
This bug still exists in 1.7.1, per the test case. It does look like changing to currentTarget will solve the problem.
Changed January 19, 2012 01:03AM UTC by comment:6
milestone: | → 1.7.2 |
---|---|
owner: | → dmethvin |
status: | reopened → assigned |
Changed January 19, 2012 09:27AM UTC by comment:7
_comment0: | Looks like it regressed in 1.7 → 1326966866149134 |
---|---|
_comment1: | Looks like it regressed in 1.7, probably due to #9393, which removed the specific liveHandler cases. → 1326967022672101 |
Looks like it regressed in 1.7, probably due to #9393, which moved the liveHandler logic into handle.