Require meta key to trigger search; change from "k" to "/"; closes #2785

This commit is contained in:
Dane Everitt 2020-12-25 15:55:31 -08:00
parent 0477e66bab
commit 9b01734752
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -9,7 +9,7 @@ export default () => {
useEventListener('keydown', (e: KeyboardEvent) => { useEventListener('keydown', (e: KeyboardEvent) => {
if ([ 'input', 'textarea' ].indexOf(((e.target as HTMLElement).tagName || 'input').toLowerCase()) < 0) { if ([ 'input', 'textarea' ].indexOf(((e.target as HTMLElement).tagName || 'input').toLowerCase()) < 0) {
if (!visible && e.key.toLowerCase() === 'k') { if (!visible && e.metaKey && e.key.toLowerCase() === '/') {
setVisible(true); setVisible(true);
} }
} }