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...
1 parent 8ce3519 commit 5e24a1ce4b337830b37511305a6ddefe797fd40c @tjvantoll tjvantoll committed with scottgonzalez Oct 16, 2012
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 );
View
@@ -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.