From: Dean Bassett Date: Mon, 18 Jul 2022 16:36:51 +0000 (-0700) Subject: Support mark as read by ESC while in room input (#669) X-Git-Tag: v2.1.0~29 X-Git-Url: https://git.wafflesoft.org/?a=commitdiff_plain;h=1211ca277b7fe1fde956176729ca1a349b317556;p=cinny.git Support mark as read by ESC while in room input (#669) fixes #cinnyapp/cinny/668 --- diff --git a/src/client/event/hotkeys.js b/src/client/event/hotkeys.js index c1b2af1..2217065 100644 --- a/src/client/event/hotkeys.js +++ b/src/client/event/hotkeys.js @@ -51,9 +51,6 @@ function listenKeyboard(event) { if (!event.ctrlKey && !event.altKey && !event.metaKey) { if (navigation.isRawModalVisible) return; - if (['input', 'textarea'].includes(document.activeElement.tagName.toLowerCase())) { - return; - } if (event.code === 'Escape') { if (navigation.isRoomSettings) { @@ -66,6 +63,10 @@ function listenKeyboard(event) { } } + if (['input', 'textarea'].includes(document.activeElement.tagName.toLowerCase())) { + return; + } + // focus the text field on most keypresses if (shouldFocusMessageField(event.code)) { // press any key to focus and type in message field