From f13b5dfa7fdb480b818cfbf07e35088460e7b5c9 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Wed, 21 Nov 2012 08:33:43 -0500 Subject: Button: add blur event to buttons. Fixes #8559 - Button: Button doesn't remove active state when using keyboard. --- tests/unit/button/button_events.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/unit') 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); -- cgit v1.2.3