Bug Tracker

Opened 8 years ago

Closed 7 years ago

#10148 closed bug (fixed)

hidden inputs are not :enabled in IE6/7

Reported by: jquery@… Owned by:
Priority: low Milestone: None
Component: selector Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:

Description

I would expect that is(':enabled') implies !is(':disabled') and vice versa, and this seems to be the case in most browsers. However, in IE 7.0.5730.13, my test case fails when it finds an <input type="hidden"> element that is apparently neither enabled nor disabled.

Link to test case: http://jsfiddle.net/joshuaecook/3fvJ7/1/

Change History (3)

comment:1 Changed 8 years ago by timmywil

Component: unfiledselector
Priority: undecidedlow
Status: newopen
Summary: is(':enabled') and is(':disabled') are not complementary in IE7hidden inputs are not :enabled in IE6/7

comment:2 Changed 8 years ago by dmethvin

Lots of ancient history here.

https://github.com/jquery/sizzle/commit/93e33dc2a41e2b0aa0e1e1c66368f5d224da80e1

As of that commit in 2008, a disabled/enabled element must have a property that is a boolean value, so that :enabled checks elem.disabled===false and won't say an arbitrary element is enabled. The check for type !== "hidden" predates the Github repo and seems to be the real issue here.

Logically it does seem like these should be complements of each other, but it's been broken this way for a LONG time.

comment:3 Changed 7 years ago by timmywil

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.