Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#12295 closed bug (worksforme)

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

Change History (5)

comment:1 Changed 7 years ago by alix

I mean : "harassingly hard bug report mechanism"

comment:2 Changed 7 years ago by alix

Last edited 7 years ago by alix (previous) (diff)

comment:3 Changed 7 years ago by alix

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 like "*:enabled" NOT "input:enabled". This problem makes extremely hidden bugs in the programmer's code. Please check the fiddle code :
http://jsfiddle.net/RJ8tb/

Version 2, edited 7 years ago by alix (previous) (next) (diff)

comment:4 Changed 7 years ago by dmethvin

Component: unfiledselector
Keywords: needsdocs added
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.

comment:5 Changed 7 years ago by mikesherov

Keywords: needsdocs removed
Note: See TracTickets for help on using tickets.