Skip to content

Commit a73e1c0

Browse files
authored
feat: Allow using space or enter to activate items. (#243)
* feat: Allow using space or enter to activate items. * fix: Fix bug that overwrote text fields when activating them with space.
1 parent 5d6ef71 commit a73e1c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/navigation_controller.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,9 @@ export class NavigationController {
404404
enter: {
405405
name: Constants.SHORTCUT_NAMES.MARK, // FIXME
406406
preconditionFn: (workspace) => this.canCurrentlyEdit(workspace),
407-
callback: (workspace) => {
407+
callback: (workspace, event) => {
408+
event.preventDefault();
409+
408410
let flyoutCursor;
409411
let curNode;
410412
let nodeType;
@@ -435,7 +437,7 @@ export class NavigationController {
435437
return false;
436438
}
437439
},
438-
keyCodes: [KeyCodes.ENTER],
440+
keyCodes: [KeyCodes.ENTER, KeyCodes.SPACE],
439441
},
440442

441443
/**

0 commit comments

Comments
 (0)