Require meta key to trigger search; change from "k" to "/"; closes #2785
This commit is contained in:
parent
0477e66bab
commit
9b01734752
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue