diff --git a/tests/visual/menu/menubar.js b/tests/visual/menu/menubar.js index 63fc34e84..323f6f681 100644 --- a/tests/visual/menu/menubar.js +++ b/tests/visual/menu/menubar.js @@ -75,8 +75,17 @@ $.widget("ui.menubar", { }; }); - $(document).click(function(event) { - !$(event.target).closest(".ui-menubar").length && self._close(); + self._bind(document, { + click: function(event) { + !$(event.target).closest(".ui-menubar").length && self._close(); + } + }) + self._bind({ + keyup: function(event) { + if (event.keyCode == $.ui.keyCode.ESCAPE) { + self._close(); + } + } }); },