aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/ContextMenu.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/ContextMenu.tsx')
-rw-r--r--src/client/views/ContextMenu.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/views/ContextMenu.tsx b/src/client/views/ContextMenu.tsx
index 5edb5fc0d..0e98d2e35 100644
--- a/src/client/views/ContextMenu.tsx
+++ b/src/client/views/ContextMenu.tsx
@@ -182,7 +182,7 @@ export class ContextMenu extends ObservableReactComponent<{ noexpand?: boolean }
@computed get menuItems() {
if (!this._searchString) {
- return this._items.map((item, ind) => <ContextMenuItem key={item.description + ind} {...item} noexpand={this.itemsNeedSearch ? true : item.noexpand} closeMenu={this.closeMenu} />);
+ return this._items.map((item, ind) => <ContextMenuItem key={item.description + ind} {...item} selected={ind === this._selectedIndex} noexpand={this.itemsNeedSearch ? true : item.noexpand} closeMenu={this.closeMenu} />);
}
return this.filteredItems.map((value, index) =>
Array.isArray(value) ? (
@@ -241,6 +241,11 @@ export class ContextMenu extends ObservableReactComponent<{ noexpand?: boolean }
}
@action
+ setLangIndex = (ind: number) => {
+ this._selectedIndex = ind;
+ };
+
+ @action
onKeyDown = (e: React.KeyboardEvent) => {
if (e.key === 'ArrowDown') {
if (this._selectedIndex < this.flatItems.length - 1) {