mirror of
https://github.com/xvvvyz/tilde.git
synced 2026-03-11 14:44:24 +00:00
bind to arrow keys for suggestion navigation
This commit is contained in:
parent
0befab25e9
commit
38eb33bd42
1 changed files with 5 additions and 3 deletions
|
|
@ -499,11 +499,13 @@
|
|||
}
|
||||
|
||||
_handleKeydown(event) {
|
||||
const isDown = event.which === 40;
|
||||
const isUp = event.which === 38;
|
||||
const isCtrlN = event.which === 78 && event.ctrlKey;
|
||||
const isCtrlP = event.which === 80 && event.ctrlKey;
|
||||
if (isCtrlN || isCtrlP) event.preventDefault();
|
||||
if (isCtrlN) this._focusNext();
|
||||
if (isCtrlP) this._focusPrevious();
|
||||
if (isDown || isDown || isCtrlN || isCtrlP) event.preventDefault();
|
||||
if (isDown || isCtrlN) this._focusNext();
|
||||
if (isUp || isCtrlP) this._focusPrevious();
|
||||
}
|
||||
|
||||
_registerClickEvents() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue