diff --git a/tests/unit/button/button_tickets.js b/tests/unit/button/button_tickets.js index 846ca7ef4..eb70181ec 100644 --- a/tests/unit/button/button_tickets.js +++ b/tests/unit/button/button_tickets.js @@ -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 = $( "" ).appendTo( "#qunit-fixture" ); + + element.button({ disabled: true }).button( "refresh" ); + ok( element.button( "option", "disabled" ), "Anchor button should remain disabled after refresh" ); +}); + })( jQuery ); diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 5ae526488..f253464df 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -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 ); }