1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Allow escape key to close context menu

This commit is contained in:
Steve-Mcl 2022-07-06 13:05:18 +01:00
parent eaa85ae8d5
commit 03f758720c

View File

@ -192,16 +192,12 @@ RED.contextMenu = (function() {
disposeMenu()
});
menu.show();
// menu.show({
// target: $('#red-ui-main-container'),
// x: options.x,
// y: options.y
// })
// set focus to first item so that pressing escape key closes the menu
$("#red-ui-workspace-context-menu :first(ul) > a").trigger("focus")
}
// Allow escape key hook and other editor events to close context menu
RED.keyboard.add("red-ui-workspace-context-menu", "escape", function () { RED.contextMenu.hide() })
return {
show: show,
hide: disposeMenu