From 22bde7957e18e8f9c4fb206227a6117dae391417 Mon Sep 17 00:00:00 2001 From: Tomoaki Hayasaka Date: Mon, 17 Apr 2023 01:58:33 +0900 Subject: [PATCH] Fix "Ctrl+Enter doesn't work when textarea has focus" regression introduced in #491. --- web/extensions/core/keybinds.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/extensions/core/keybinds.js b/web/extensions/core/keybinds.js index 1825007a..42c22801 100644 --- a/web/extensions/core/keybinds.js +++ b/web/extensions/core/keybinds.js @@ -5,12 +5,6 @@ app.registerExtension({ name: id, init() { const keybindListener = function(event) { - const target = event.composedPath()[0]; - - if (target.tagName === "INPUT" || target.tagName === "TEXTAREA") { - return; - } - const modifierPressed = event.ctrlKey || event.metaKey; // Queue prompt using ctrl or command + enter @@ -19,6 +13,12 @@ app.registerExtension({ return; } + const target = event.composedPath()[0]; + + if (target.tagName === "INPUT" || target.tagName === "TEXTAREA") { + return; + } + const modifierKeyIdMap = { "s": "#comfy-save-button", 83: "#comfy-save-button",