Skip to content
Permalink
Browse files

Button: Check for ui-state-disabled during refresh. Fixes #8237 - But…

…ton: Anchor tags cannot be disabled within buttonset.
  • Loading branch information...
tjvantoll authored and scottgonzalez committed Oct 16, 2012
1 parent 8ce3519 commit 5e24a1ce4b337830b37511305a6ddefe797fd40c
Showing with 9 additions and 1 deletion.
  1. +8 −0 tests/unit/button/button_tickets.js
  2. +1 −1 ui/jquery.ui.button.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 = $( "<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 );
@@ -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 );
}

0 comments on commit 5e24a1c

Please sign in to comment.
You can’t perform that action at this time.