From 1c57d1f45c89bd6b3dfc01bff92e0a754bfccb45 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Wed, 30 Sep 2020 20:08:39 +0200 Subject: [PATCH] #54 Avoid quick search hotkey if input is focused --- src/javascript/enhancements/quickSearch.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/javascript/enhancements/quickSearch.js b/src/javascript/enhancements/quickSearch.js index 38185ff..95b31d5 100644 --- a/src/javascript/enhancements/quickSearch.js +++ b/src/javascript/enhancements/quickSearch.js @@ -64,7 +64,12 @@ function handleQuickSearch(event) { function handleSearchForShiftF(event) { if (helper.isShiftPressed) { - if (event.key === 'F') { + // check if some kind of input is focused already; we then prevent our hotkey + if (document.activeElement instanceof HTMLInputElement || document.activeElement.isContentEditable) { + return; + } + + if (event.code === 'KeyF') { event.preventDefault(); document.getElementById(quickSearchID).focus(); } -- 2.43.5