From 298baed59f0445ed2cf57842fba64659a24b2de2 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Sun, 18 Aug 2024 03:16:29 +0200 Subject: [PATCH] Open popups should block all default hotkeys - Fixes #2570 --- public/scripts/RossAscends-mods.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index 9552a488d..4fa4ff603 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -954,6 +954,11 @@ export function initRossMods() { * @param {KeyboardEvent} event */ async function processHotkeys(event) { + // Default hotkeys and shortcuts shouldn't work if any popup is currently open + if (Popup.util.isPopupOpen()) { + return; + } + //Enter to send when send_textarea in focus if (document.activeElement == hotkeyTargets['send_textarea']) { const sendOnEnter = shouldSendOnEnter(); @@ -1107,10 +1112,6 @@ export function initRossMods() { } if (event.key == 'Escape') { //closes various panels - // Do not close panels if we are currently inside a popup - if (Popup.util.isPopupOpen()) - return; - //dont override Escape hotkey functions from script.js //"close edit box" and "cancel stream generation". if ($('#curEditTextarea').is(':visible') || $('#mes_stop').is(':visible')) {