From c24d7fafa95bad9aaa53d524248c5c8b2f72ba76 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 5 Aug 2022 21:19:45 +0100 Subject: [PATCH] Remove d3 from keyboard.js --- .../@node-red/editor-client/src/js/ui/keyboard.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 40e11aa72..c91961253 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 @@ -267,7 +267,7 @@ RED.keyboard = (function() { return resolveKeyEvent(evt); } if (Object.keys(handler).length > 0) { - // check if there's a potential combined handler initiated by this keyCode + // check if there's a potential combined handler initiated by this keyCode for (let h in handler) { if (matchHandlerToEvent(evt,handler[h]) > -1) { partialState = handler; @@ -298,21 +298,21 @@ RED.keyboard = (function() { return resolveKeyEvent(evt); } } - d3.select(window).on("keydown",function() { + document.addEventListener("keydown", function(event) { if (!handlersActive) { return; } - if (metaKeyCodes[d3.event.keyCode]) { + if (metaKeyCodes[event.keyCode]) { return; } - var handler = resolveKeyEvent(d3.event); + var handler = resolveKeyEvent(event); if (handler && handler.ondown) { if (typeof handler.ondown === "string") { RED.actions.invoke(handler.ondown); } else { handler.ondown(); } - d3.event.preventDefault(); + event.preventDefault(); } });