diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2012-11-21 08:33:43 -0500 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2012-11-21 19:14:04 -0500 |
commit | f13b5dfa7fdb480b818cfbf07e35088460e7b5c9 (patch) | |
tree | 9b3f8ec59bf11c3c254684bcace703fac3f117c0 /tests | |
parent | c348f2890c3b44d81b54ae9a069152943a2da7e7 (diff) | |
download | jquery-ui-f13b5dfa7fdb480b818cfbf07e35088460e7b5c9.tar.gz jquery-ui-f13b5dfa7fdb480b818cfbf07e35088460e7b5c9.zip |
Button: add blur event to buttons. Fixes #8559 - Button: Button doesn't remove active state when using keyboard.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/button/button_events.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/button/button_events.js b/tests/unit/button/button_events.js index ad83101d0..bb2cb041c 100644 --- a/tests/unit/button/button_events.js +++ b/tests/unit/button/button_events.js @@ -13,4 +13,14 @@ test("buttonset works with single-quote named elements (#7505)", function() { }).click(); }); +test( "when button loses focus, ensure active state is removed (#8559)", function() { + expect( 1 ); + + $("#button").button().keypress( function() { + $("#button").blur( function() { + ok( !$("#button").is(".ui-state-active"), "button loses active state appropriately" ); + }).blur(); + }).focus().simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ).simulate( "keypress", { keyCode: $.ui.keyCode.ENTER } ); +}); + })(jQuery); |