From: jzaefferer Date: Thu, 17 Mar 2011 13:23:35 +0000 (+0100) Subject: Menubar: Put focus back to button when closing menu X-Git-Tag: 1.9m5~207 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d4a81ec0432595c90a1808220ebd66ef6b6c8511;p=jquery-ui.git Menubar: Put focus back to button when closing menu --- diff --git a/tests/visual/menu/menubar.js b/tests/visual/menu/menubar.js index 1da54d532..9826a7e69 100644 --- a/tests/visual/menu/menubar.js +++ b/tests/visual/menu/menubar.js @@ -92,8 +92,10 @@ $.widget("ui.menubar", { self._bind({ keyup: function(event) { if (event.keyCode == $.ui.keyCode.ESCAPE) { - if (self.active.menu("left") !== true) { - self._close(); + if (self.active.menu("left", event) !== true) { + self._close( event ); + // bypass the focus event handler above + self.active.prev()[0].focus(); } } }