Skip to content

Commit d406c7c

Browse files
committed
fix input s into a form without triggering search
1 parent b7f4621 commit d406c7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/theme/searcher/searcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ window.search = window.search || {};
316316

317317
// Eventhandler for keyevents on `document`
318318
function globalKeyHandler(e) {
319-
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || e.target.type === 'textarea' || e.target.type === 'text') { return; }
319+
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; }
320320

321321
if (e.keyCode === ESCAPE_KEYCODE) {
322322
e.preventDefault();

0 commit comments

Comments
 (0)