Skip to content

Commit 5e24a1c

Browse files
tjvantollscottgonzalez
authored andcommitted
Button: Check for ui-state-disabled during refresh. Fixes #8237 - Button: Anchor tags cannot be disabled within buttonset.
1 parent 8ce3519 commit 5e24a1c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tests/unit/button/button_tickets.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,12 @@ test( "#7534 - Button label selector works for ids with \":\"", function() {
6161
ok( group.find( "label" ).is( ".ui-button" ), "Found an id with a :" );
6262
});
6363

64+
test( "#8237 - Anchor tags lose disabled state when refreshed", function() {
65+
expect( 1 );
66+
var element = $( "<a id='a8237'></a>" ).appendTo( "#qunit-fixture" );
67+
68+
element.button({ disabled: true }).button( "refresh" );
69+
ok( element.button( "option", "disabled" ), "Anchor button should remain disabled after refresh" );
70+
});
71+
6472
})( jQuery );

ui/jquery.ui.button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ $.widget( "ui.button", {
282282
},
283283

284284
refresh: function() {
285-
var isDisabled = this.element.is( ":disabled" );
285+
var isDisabled = this.element.is( ":disabled" ) || this.element.hasClass( "ui-button-disabled" );
286286
if ( isDisabled !== this.options.disabled ) {
287287
this._setOption( "disabled", isDisabled );
288288
}

0 commit comments

Comments
 (0)