From 5a112d4e03b4c1073e2136b83ed8316c13eaa536 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Thu, 17 Mar 2011 17:43:11 +0100 Subject: [PATCH] Menu: Close submenu on ESCAPE keypress --- ui/jquery.ui.menu.js | 6 ++++++ 1 file changed, 6 insertions(+) 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);