From 4af8d5285d84c4182efef397600377aeeb64c797 Mon Sep 17 00:00:00 2001 From: Dominik Reh Date: Sun, 23 Oct 2022 14:50:04 +0200 Subject: [PATCH] Make left/right arrow key navigation optional Fixes #31 --- javascript/tagAutocomplete.js | 4 +++- tags/config.json | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/javascript/tagAutocomplete.js b/javascript/tagAutocomplete.js index b8365dd..84eea9b 100644 --- a/javascript/tagAutocomplete.js +++ b/javascript/tagAutocomplete.js @@ -465,7 +465,9 @@ function navigateInList(textArea, event) { // Return if the function is deactivated in the UI if (!acActive) return; - validKeys = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter", "Tab", "Escape"]; + validKeys = ["ArrowUp", "ArrowDown", "Enter", "Tab", "Escape"]; + if (acConfig.useLeftRightArrowKeys) + validKeys.push("ArrowLeft", "ArrowRight"); if (!validKeys.includes(event.key)) return; if (!isVisible(textArea)) return diff --git a/tags/config.json b/tags/config.json index ac381c6..3871b08 100644 --- a/tags/config.json +++ b/tags/config.json @@ -8,6 +8,7 @@ "maxResults": 5, "resultStepLength": 500, "showAllResults": false, + "useLeftRightArrowKeys": false, "replaceUnderscores": true, "escapeParentheses": true, "useWildcards": true,