From 3726d6fe3b81f8cc11d68833630968501b37d109 Mon Sep 17 00:00:00 2001 From: ralphwetzel Date: Thu, 30 Jun 2022 21:52:16 +0200 Subject: [PATCH] Finetune keyboard shortcut management --- .../editor-client/src/js/ui/keyboard.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/keyboard.js b/packages/node_modules/@node-red/editor-client/src/js/ui/keyboard.js index d9511269d..ae104637c 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/keyboard.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/keyboard.js @@ -265,13 +265,18 @@ RED.keyboard = (function() { if (partialState) { partialState = null; return resolveKeyEvent(evt); - } else if (Object.keys(handler).length > 0) { - partialState = handler; - evt.preventDefault(); - return null; - } else { - return null; } + if (Object.keys(handler).length > 0) { + // check if there's a potential combined handler initiated by this keyCode + for (h in handler) { + if (matchHandlerToEvent(evt,handler[h]) > -1) { + partialState = handler; + evt.preventDefault(); + break; + } + } + } + return null; } else { var depth = Infinity; var matchedHandler;