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.

This commit is contained in:
Scott González 2013-09-16 11:57:35 -04:00
parent 1552fc8a05
commit d13df39e39

View File

@ -352,9 +352,13 @@ $.Widget.prototype = {
if ( key === "disabled" ) {
this.widget()
.toggleClass( this.widgetFullName + "-disabled", !!value );
// If the widget is becoming disabled, then nothing is interactive
if ( value ) {
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
}
}
return this;
},