#11872 closed bug (wontfix)
$('option:enabled') does not work in Chrome
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | selector | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Here's a fiddle http://jsfiddle.net/aDHen/ demo.
Expected result: 1
Actual result: 0 (in Chrome. FF/IE9 work fine)
The fiddle is 1.7.2 but I discovered it in a codebase using 1.5.0
Change History (8)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Component: | unfiled → selector |
---|---|
Priority: | undecided → low |
Resolution: | → cantfix |
Status: | new → closed |
This is a querySelectorAll bug, and not jQuery specific.
document.querySelectorAll('option:enabled')
will also not work.
While document.querySelectorAll('option:not([disabled])')
does work.
Just use $('option:not([disabled])')
and you'll be fine.
comment:3 Changed 11 years ago by
Apparently this has been fixed in Chrome Canary 21, so expect a fix for this in a month or two ;)
comment:4 Changed 11 years ago by
Milestone: | None → 1.8 |
---|---|
Resolution: | cantfix |
Status: | closed → reopened |
Actually, if jQuery git were updating, I'd be able to show you that this has been fixed. There is a test in the suite. We now bypass querySelectorAll in certain use cases and this is one.
comment:5 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:6 Changed 11 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
OK, I take that back. The :enabled test I had was for something else. We could fix this, but I don't think it is worth the code since Chrome will have this fixed soon enough, making our fix moot fairly quickly.
comment:7 Changed 11 years ago by
Milestone: | 1.8 → None |
---|---|
Resolution: | → wontfix |
Status: | reopened → closed |
comment:8 Changed 11 years ago by
Thanks for looking into this. I've never seen a ticket closed and reopened so many times! :)
I will just use the inverse in my code - ":not(:disabled)"
Thanks again, and great work with this project! This is the number 1 most essential tool in my developer toolkit.
I forgot to include my OS: I'm using Windows 7 64 bit. I'm expecting ":enabled" to select the options in the select tag that aren't disabled. Instead it's selecting nothing.