Opened 9 years ago

Closed 8 years ago

Last modified 7 years ago

#5604 closed bug (duplicate)

Button: ui-state- class names not going away

Reported by: cwolgast Owned by:
Priority: minor Milestone:
Component: ui.button Version: 1.8.1
Keywords: button Cc:
Blocked by: Blocking:

Description

When having a button fire a function of various kinds the classes ui-state-focus and ui-state-hover will be "locked" in the button. At least two use case scenarios I've managed to find (that are easily reproducable) can be found at:

http://crowded.se/test/e.php (when opening a dialog) http://crowded.se/test/f.php (when disabling/enabling a button)

Change History (5)

comment:1 Changed 9 years ago by rdworth

Summary: Interaction class names not going awayButton: ui-state- class names not going away

comment:2 Changed 9 years ago by robot

I have also experienced this issue. After some investigation, I found that the reason for this bug is that the button widget doesn't always get notified about events which might affect its state.

It's possible to fix the 2 examples given by cwolgast using the following 2 solutions:

For the dialog:

Insert the following line of code to the file jquery.ui.dialog.js

-on line 205 (the second next line after "self.element.attr('title', self.originalTitle);")

and

-on line 249 (the second next line after "$.ui.dialog.maxZ = maxZ;")

    $('.ui-state-focus').each (function (){ $(this).trigger ('blur') });

For the button:

Insert the following line of code to the file jquery.ui.button.js

-on line 236 (the next line after "this.element.attr( "disabled", true );")

    $(this.element).trigger ('blur').removeClass ('ui-state-hover');



(Tested this with jquery 1.8.4 on Firefox 3.6.8 / Linux)

comment:3 in reply to:  2 Changed 9 years ago by robot

Oh, I meant jquery-ui 1.8.4

comment:4 Changed 8 years ago by Scott González

Resolution: duplicate
Status: newclosed

This is a duplicate of #5265 (dialog) and #5295 (disable).

comment:5 Changed 7 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.