aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2013-04-11 14:03:51 -0400
committerScott González <scott.gonzalez@gmail.com>2013-04-11 14:03:51 -0400
commit0d0b05ec7cf702b8782b19c993eeb30398a090f4 (patch)
treec06124bf3ec7c490346f329df3bf700d80e2d4e6 /tests
parent2de31fdbf498a6c20d196a96d007ea0f069644c5 (diff)
downloadjquery-ui-0d0b05ec7cf702b8782b19c993eeb30398a090f4.tar.gz
jquery-ui-0d0b05ec7cf702b8782b19c993eeb30398a090f4.zip
Button: Remove ui-state-focus class when becoming disabled. Fixes #9169 - Button: Disabled button maintains ui-state-focus in IE & Firefox on Windows.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/button/button.html2
-rw-r--r--tests/unit/button/button_core.js13
2 files changed, 15 insertions, 0 deletions
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 @@
<div><input id="submit" type="submit" value="Label"></div>
+<button id="button1">Button</button>
+
</div>
</body>
</html>
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);