This commit is contained in:
Jan Prochazka
2021-03-27 10:20:40 +01:00
parent d8fcbc8c17
commit 987fe6095a
3 changed files with 11 additions and 5 deletions

View File

@@ -63,7 +63,11 @@
function handleKeyDown(e) {
if (e.keyCode == keycodes.upArrow && selectedIndex > 0) selectedIndex--;
if (e.keyCode == keycodes.downArrow && selectedIndex < filteredItems.length - 1) selectedIndex++;
if (e.keyCode == keycodes.enter) handleCommand(filteredItems[selectedIndex]);
if (e.keyCode == keycodes.enter) {
e.preventDefault();
e.stopPropagation();
handleCommand(filteredItems[selectedIndex]);
}
if (e.keyCode == keycodes.escape) $visibleCommandPalette = false;
if (e.keyCode == keycodes.pageDown) selectedIndex = Math.min(selectedIndex + 15, filteredItems.length - 1);