From d4a81ec0432595c90a1808220ebd66ef6b6c8511 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Thu, 17 Mar 2011 14:23:35 +0100 Subject: [PATCH] Menubar: Put focus back to button when closing menu --- tests/visual/menu/menubar.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(); } } } -- 2.39.5