From: jzaefferer Date: Thu, 17 Mar 2011 16:43:11 +0000 (+0100) Subject: Menu: Close submenu on ESCAPE keypress X-Git-Tag: 1.9m5~201 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5a112d4e03b4c1073e2136b83ed8316c13eaa536;p=jquery-ui.git Menu: Close submenu on ESCAPE keypress --- diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index ad2fa3092..af1101f73 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -112,6 +112,12 @@ $.widget("ui.menu", { event.preventDefault(); event.stopImmediatePropagation(); break; + case $.ui.keyCode.ESCAPE: + if ( self.left( event ) ) { + event.stopImmediatePropagation(); + } + event.preventDefault(); + break; default: event.stopPropagation(); clearTimeout(self.filterTimer);