« get me outta code hell

client: scripted-link: ignore while input or textarea focused - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-11-20 17:34:26 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-11-20 17:34:56 -0400
commitadf8035778d409cd2a57d3a537193b4bdb3f1503 (patch)
treea062f38a99cb2449da86b0164bd1c4fda5cbb1ee /src/static
parent01ad4dda0d8609fbfb2759cc1bb975b9c6b71c58 (diff)
client: scripted-link: ignore while input or textarea focused
Fixes #551
Diffstat (limited to 'src/static')
-rw-r--r--src/static/js/client/scripted-link.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/static/js/client/scripted-link.js b/src/static/js/client/scripted-link.js
index ca1c2548..8b8d8a13 100644
--- a/src/static/js/client/scripted-link.js
+++ b/src/static/js/client/scripted-link.js
@@ -208,6 +208,11 @@ function mutateNavigationLinkContent() {
 
 function addNavigationKeyPressListeners() {
   document.addEventListener('keypress', (event) => {
+    const {tagName} = document.activeElement ?? {};
+    if (tagName === 'INPUT' || tagName === 'TEXTAREA') {
+      return;
+    }
+
     if (event.shiftKey) {
       if (event.charCode === 'N'.charCodeAt(0)) {
         info.nextNavLink?.click();