Skip to content

Commit

Permalink
Merge pull request #2311 from sspaeti/fix-search-with-form
Browse files Browse the repository at this point in the history
fix input `s` into a form without triggering search
  • Loading branch information
ehuss authored Feb 7, 2024
2 parents 9cf3117 + d406c7c commit bc5cd13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/theme/searcher/searcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit bc5cd13

Please sign in to comment.