]> source.dussan.org Git - jquery-ui.git/commitdiff
Menubar: Put focus back to button when closing menu
authorjzaefferer <joern.zaefferer@gmail.com>
Thu, 17 Mar 2011 13:23:35 +0000 (14:23 +0100)
committerjzaefferer <joern.zaefferer@gmail.com>
Thu, 17 Mar 2011 13:23:35 +0000 (14:23 +0100)
tests/visual/menu/menubar.js

index 1da54d532c02aef23b7659f579aa54c17c37ad41..9826a7e69f070e560adf889a00b69d3ee6efc721 100644 (file)
@@ -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();
                                        }
                                }
                        }