Skip to content

Commit d13df39

Browse files
committed
Widget: Only remove hover and focus classes when disabling, not enabling. Fixes #9558 - Widget: .enable() while already enabled kills ui-state-focus and ui-state-hover.
1 parent 1552fc8 commit d13df39

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ui/jquery.ui.widget.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,12 @@ $.Widget.prototype = {
352352
if ( key === "disabled" ) {
353353
this.widget()
354354
.toggleClass( this.widgetFullName + "-disabled", !!value );
355-
this.hoverable.removeClass( "ui-state-hover" );
356-
this.focusable.removeClass( "ui-state-focus" );
355+
356+
// If the widget is becoming disabled, then nothing is interactive
357+
if ( value ) {
358+
this.hoverable.removeClass( "ui-state-hover" );
359+
this.focusable.removeClass( "ui-state-focus" );
360+
}
357361
}
358362

359363
return this;

0 commit comments

Comments
 (0)