diff options
Diffstat (limited to '')
-rw-r--r-- | static/script.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/static/script.ts b/static/script.ts index 34443b16..f243dd67 100644 --- a/static/script.ts +++ b/static/script.ts @@ -255,11 +255,12 @@ window.addEventListener('load', function() { }); document.addEventListener('keydown', function(event) { - if (event.key == '/') { - let searchbox = document.querySelector('.simplesearch [name=q]') as HTMLInputElement - // focuses the input, and selects all the text in it - searchbox.select(); - event.preventDefault(); - } + if (event.key !== '/') return; + if ('value' in (event.target as any)) return; + + let searchbox = document.querySelector('.simplesearch [name=q]') as HTMLInputElement + // focuses the input, and selects all the text in it + searchbox.select(); + event.preventDefault(); }); }) |