Skip to main content

Search and Top Navigation

#9602 closed bug (fixed)

Opened October 15, 2013 08:56AM UTC

Closed April 21, 2014 01:15PM UTC

Last modified April 21, 2014 01:15PM UTC

Button: ui-state-active remains on disabled button

Reported by: darek Owned by:
Priority: minor Milestone: 1.11.0
Component: ui.button Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:
Description

If a button gets disabled during click it doesn't go into "disabled" state correctly and it has both "active" and "disabled" styles. Here's the demonstrated situation:

http://jsfiddle.net/Qsym6/4/

It is reproducible on the latest Chrome and Firefox. On IE9 it works a little bit better but it is also buggy.

Attachments (0)
Change History (7)

Changed October 15, 2013 12:13PM UTC by tj.vantoll comment:1

resolution: → notabug
status: newclosed

Your test case is using a very old version of jQuery UI. This appears to be working fine in the latest version - http://jsfiddle.net/tj_vantoll/PeDqr/. If you can recreate the issue with 1.10.3 let us know.

Changed October 15, 2013 12:32PM UTC by darek comment:2

My problem is also visible on jQueryUI 1.10.3 but not with the latest official css theme. The main problem is that button element gets two classes in my scenario: "ui-button-disabled" (which is right) and "ui-state-active" (which I believe is not right for disabled button). Here's the generated markup from your jsFiddle:

<button type="button" id="btn" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-active ui-button-disabled ui-state-disabled" role="button" aria-disabled="true" disabled=""><span class="ui-button-text">Button</span></button>

I have my own CSS and I can mask the problem there, but shouldn't "ui-state-active" class be always removed for disabled button?

Changed October 15, 2013 12:49PM UTC by tj.vantoll comment:3

resolution: notabug
status: closedreopened
summary: Button doesn't remove active state when disabled and clickedButton: ui-state-active remains on disabled button

Ok, I see this now. The internal

mousedown
handler (that adds
ui-state-active
is running before the custom
blur
event. You can workaround this for now with a
setTimeout
- http://jsfiddle.net/tj_vantoll/eyBmD/.

I suppose we should just blanket remove

ui-state-active
when disabling a button. I can't think of a reason to ever leave it.

Changed October 15, 2013 12:51PM UTC by tj.vantoll comment:4

status: reopenedopen

Changed December 12, 2013 04:58AM UTC by robotdan comment:5

_comment0: \ > I suppose we should just blanket remove ui-state-active when disabling a button. I can't think of a reason to ever leave it. \ \ \\\\ \ I've submitted a pull request. https://github.com/jquery/jquery-ui/pull/11511386824680681027
I suppose we should just blanket remove ui-state-active when disabling a button. I can't think of a reason to ever leave it.

\\\\

I've submitted a pull request and updated the testcase to use the fix branch.

https://github.com/jquery/jquery-ui/pull/1151 \\\\

http://jsfiddle.net/VeX37/1/

Changed April 21, 2014 01:15PM UTC by Daniel DeGroff comment:6

resolution: → fixed
status: openclosed

Button: Remove ui-state-active when disabling buttons

Fixes #9602

Closes gh-1151

Changeset: 23d7d50f374f71efec418276a343e947cb80aea6

Changed April 21, 2014 01:15PM UTC by scottgonzalez comment:7

milestone: none1.11.0