Skip to main content

Bug Tracker

Side navigation

#12295 closed bug (worksforme)

Opened August 14, 2012 01:35PM UTC

Closed August 21, 2012 12:54AM UTC

Last modified October 15, 2012 09:54PM UTC

It`s not closed : "live" / "delegate" bug about ":enabled" filter

Reported by: alix Owned by:
Priority: low Milestone: None
Component: selector Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:
Description

With regard to jQuery Documentation(:enabled) on http://api.jquery.com/enabled-selector/ describing : ".... In other words, the bare $(':enabled') is equivalent to $('*:enabled'), so $('input:enabled') should be used instead. .... "

But in fact the subject is different. Let's take a look:

http://jsfiddle.net/RJ8tb/

AND

I had made similar Ticket previously http://bugs.jquery.com/ticket/12288 but someone closed it. Hey jQuery! can you please and let users to have more time to complete the ticket (for example posting fiddle code)

I think with this harassingly hard bug mechanism of jQuery, people will be satisfied to report no more bugs

Attachments (0)
Change History (5)

Changed August 14, 2012 01:40PM UTC by alix comment:1

I mean : "harassingly hard bug report mechanism"

Changed August 14, 2012 01:43PM UTC by alix comment:2

_comment0: With regard to jQuery Documentation(:enabled) on [http://api.jquery.com/enabled-selector/] describing : ".... In other words, the bare $(':enabled') is equivalent to $('*:enabled'), so $('input:enabled') should be used instead. .... " \ But in fact the subject is different. Let's take a look:[[BR]] \ [http://jsfiddle.net/RJ8tb/][[BR]] \ 1344952150391188

Changed August 14, 2012 01:55PM UTC by alix comment:3

_comment0: Changed 64 minutes ago by dmethvin[[BR]] \ Status changed from pending to closed[[BR]] \ Resolution set to invalid[[BR]] \ $('[rel*="Async"]:not(:text, :password, select, textarea):not([rel*="NotAsync"])').not('[disabled]').live('click', fun... \ [[BR]][[BR]] \ The .live method cannot be used in a chain like that, see the documentation. Also, .live is deprecated. \ [[BR]] \ [[BR]] \ OK there is no problem with .live because the actual bug is from :enabled selector returning different result against :not(:disabled) and the bug is same with live and delegate.[[BR]] \ As described in documentation : ":enabled" should be like "*:enabled" NOT "input:enabled". This problem makes extremely hidden bugs in the programmer's code. Please check the fiddle code :[[BR]] \ [http://jsfiddle.net/RJ8tb/]1344952612796835
_comment1: Changed 64 minutes ago by dmethvin[[BR]] \ Status changed from pending to closed[[BR]] \ Resolution set to invalid[[BR]] \ $('[rel*="Async"]:not(:text, :password, select, textarea):not([rel*="NotAsync"])').not('[disabled]').live('click', fun... \ [[BR]] \ The .live method cannot be used in a chain like that, see the documentation. Also, .live is deprecated. \ [[BR]] \ [[BR]] \ [[BR]] \ OK there is no problem with .live because the actual bug is from :enabled selector returning different result against :not(:disabled) and the bug is same with live and delegate.[[BR]] \ As described in documentation : ":enabled" should be like "*:enabled" NOT "input:enabled". This problem makes extremely hidden bugs in the programmer's code. Please check the fiddle code :[[BR]] \ [http://jsfiddle.net/RJ8tb/]1344952645460870
_comment2: Changed 64 minutes ago by dmethvin[[BR]] \ Status changed from pending to closed[[BR]] \ Resolution set to invalid[[BR]] \ $('[rel*="Async"]:not(:text, :password, select, textarea):not([rel*="NotAsync"])').not('[disabled]').live('click', fun... \ [[BR]] \ The .live method cannot be used in a chain like that, see the documentation. Also, .live is deprecated. \ [[BR]] \ ---- \ [[BR]] \ OK there is no problem with .live because the actual bug is from :enabled selector returning different result against :not(:disabled) and the bug is same with live and delegate.[[BR]] \ As described in documentation : ":enabled" should be like "*:enabled" NOT "input:enabled". This problem makes extremely hidden bugs in the programmer's code. Please check the fiddle code :[[BR]] \ [http://jsfiddle.net/RJ8tb/]1344953318175947

Changed 64 minutes ago by dmethvin

Status changed from pending to closed

Resolution set to invalid

$('[rel*="Async"]:not(:text, :password, select, textarea):not([rel*="NotAsync"])').not('[disabled]').live('click', fun...

The .live method cannot be used in a chain like that, see the documentation. Also, .live is deprecated.


OK there is no problem with .live because the actual bug is from :enabled selector returning different result against :not(:disabled) and the bug is same with live and delegate.

As described in documentation : ":enabled" should be same as "*:enabled" NOT "input:enabled". This problem makes extremely hidden bugs in the programmer's code. Please check the fiddle code :

http://jsfiddle.net/RJ8tb/

Changed August 21, 2012 12:54AM UTC by dmethvin comment:4

component: unfiledselector
keywords: → needsdocs
priority: undecidedlow
resolution: → worksforme
status: newclosed

These are different things. "[disabled]" means it has a disabled attribute, regardless of the attribute's value. :enabled and :disabled are jQuery extensions, implemented this way:

"enabled": function( elem ) {
    return elem.disabled === false;
},
"disabled": function( elem ) {
    return elem.disabled === true;
},

The value of the .disabled **property** can have other values, such as undefined, that would mean it is neither enabled nor disabled. It usually doesn't make sense to ask about the enabled/disabled state of elements that don't have an intrinsic notion of that--mostly input elements.

Changed October 15, 2012 09:54PM UTC by mikesherov comment:5

keywords: needsdocs