mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Button: Check for ui-state-disabled during refresh. Fixes #8237 - Button: Anchor tags cannot be disabled within buttonset.
This commit is contained in:
parent
8ce35198da
commit
5e24a1ce4b
@ -61,4 +61,12 @@ test( "#7534 - Button label selector works for ids with \":\"", function() {
|
||||
ok( group.find( "label" ).is( ".ui-button" ), "Found an id with a :" );
|
||||
});
|
||||
|
||||
test( "#8237 - Anchor tags lose disabled state when refreshed", function() {
|
||||
expect( 1 );
|
||||
var element = $( "<a id='a8237'></a>" ).appendTo( "#qunit-fixture" );
|
||||
|
||||
element.button({ disabled: true }).button( "refresh" );
|
||||
ok( element.button( "option", "disabled" ), "Anchor button should remain disabled after refresh" );
|
||||
});
|
||||
|
||||
})( jQuery );
|
||||
|
2
ui/jquery.ui.button.js
vendored
2
ui/jquery.ui.button.js
vendored
@ -282,7 +282,7 @@ $.widget( "ui.button", {
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
var isDisabled = this.element.is( ":disabled" );
|
||||
var isDisabled = this.element.is( ":disabled" ) || this.element.hasClass( "ui-button-disabled" );
|
||||
if ( isDisabled !== this.options.disabled ) {
|
||||
this._setOption( "disabled", isDisabled );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user