Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#12726 closed bug (duplicate)

is(':active') reports false even if button is active

Reported by: a@… Owned by:
Priority: low Milestone: 1.9
Component: selector Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

Description

is(':active') will report false for button in active state. $('*:active') will still select this element as active. Workaround: use $('*:active').filter(el).length > 0 instead of $(el).is(:active).

In code: el.is(':active') == $('*:active').filter(el).length > 0; should always be true. It is not.

Example fiddle: http://jsfiddle.net/atotic/HzSY6/

Change History (2)

comment:1 Changed 7 years ago by timmywil

Component: unfiledselector
Milestone: None1.9
Priority: undecidedlow
Resolution: duplicate
Status: newclosed

Confirmed. There is a bigger issue with :active here.

http://jsfiddle.net/HzSY6/8/

I think we should look into alternate implementations (possibly including an event) for this selector in 1.9.

Porting this to Sizzle issue.

Note: See TracTickets for help on using tickets.