From d406c7c09bd45b5dfe6df6661f020c6c632ebc1c Mon Sep 17 00:00:00 2001 From: sspaeti Date: Tue, 6 Feb 2024 10:15:56 +0100 Subject: [PATCH] fix input `s` into a form without triggering search --- src/theme/searcher/searcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/searcher/searcher.js b/src/theme/searcher/searcher.js index d2b0aeed..dc03e0a0 100644 --- a/src/theme/searcher/searcher.js +++ b/src/theme/searcher/searcher.js @@ -316,7 +316,7 @@ window.search = window.search || {}; // Eventhandler for keyevents on `document` function globalKeyHandler(e) { - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || e.target.type === 'textarea' || e.target.type === 'text') { return; } + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || e.target.type === 'textarea' || e.target.type === 'text' || !hasFocus() && /^(?:input|select|textarea)$/i.test(e.target.nodeName)) { return; } if (e.keyCode === ESCAPE_KEYCODE) { e.preventDefault();