Bug Tracker

Modify

Ticket #12295 (closed bug: worksforme)

Opened 9 months ago

Last modified 7 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 9 months ago by alix

I mean : "harassingly hard bug report mechanism"

comment:2 Changed 9 months ago by alix

Last edited 9 months ago by alix (previous) (diff)

comment:3 Changed 9 months 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 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/

Last edited 9 months ago by alix (previous) (diff)

comment:4 Changed 9 months ago by dmethvin

  • Keywords needsdocs added
  • Priority changed from undecided to low
  • Status changed from new to closed
  • Component changed from unfiled to selector
  • Resolution set to worksforme

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 months ago by mikesherov

  • Keywords needsdocs removed

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.