#9602 closed bug (fixed)
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:
It is reproducible on the latest Chrome and Firefox. On IE9 it works a little bit better but it is also buggy.
Change History (7)
comment:1 Changed 9 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
comment:2 Changed 9 years ago by
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?
comment:3 Changed 9 years ago by
Resolution: | notabug |
---|---|
Status: | closed → reopened |
Summary: | Button doesn't remove active state when disabled and clicked → Button: 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.
comment:4 Changed 9 years ago by
Status: | reopened → open |
---|
comment:5 Changed 9 years ago by
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/
comment:6 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Button: Remove ui-state-active
when disabling buttons
Fixes #9602 Closes gh-1151
Changeset: 23d7d50f374f71efec418276a343e947cb80aea6
comment:7 Changed 9 years ago by
Milestone: | none → 1.11.0 |
---|
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.