From 0d0b05ec7cf702b8782b19c993eeb30398a090f4 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 11 Apr 2013 14:03:51 -0400 Subject: Button: Remove ui-state-focus class when becoming disabled. Fixes #9169 - Button: Disabled button maintains ui-state-focus in IE & Firefox on Windows. --- tests/unit/button/button.html | 2 ++ tests/unit/button/button_core.js | 13 +++++++++++++ 2 files changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/unit/button/button.html b/tests/unit/button/button.html index eeb568686..223581ef7 100644 --- a/tests/unit/button/button.html +++ b/tests/unit/button/button.html @@ -71,6 +71,8 @@
+ + diff --git a/tests/unit/button/button_core.js b/tests/unit/button/button_core.js index 16c7ca450..55dda68b3 100644 --- a/tests/unit/button/button_core.js +++ b/tests/unit/button/button_core.js @@ -196,4 +196,17 @@ test( "#7534 - Button label selector works for ids with \":\"", function() { ok( group.find( "label" ).is( ".ui-button" ), "Found an id with a :" ); }); +asyncTest( "#9169 - Disabled button maintains ui-state-focus", function() { + expect( 2 ); + var element = $( "#button1" ).button(); + element[ 0 ].focus(); + setTimeout(function() { + ok( element.hasClass( "ui-state-focus" ), "button has ui-state-focus" ); + element.button( "disable" ); + ok( !element.hasClass( "ui-state-focus" ), + "button does not have ui-state-focus when disabled" ); + start(); + }); +}); + })(jQuery); -- cgit v1.2.3