Skip to content

Commit

Permalink
never click on candidate from typing, just focus
Browse files Browse the repository at this point in the history
  • Loading branch information
abaevbog committed Oct 10, 2024
1 parent 3eb0441 commit b9c5c6b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/common/components/context-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,8 @@ function ContextMenu({ params, onClose }) {
let menuOptions = [...document.querySelectorAll(".context-menu button:not([disabled])")];
let candidates = menuOptions.filter(option => option.textContent.toLowerCase().startsWith(searchStringRef.current));

// If there is only one candidate, click it right away
if (candidates.length == 1) {
candidates[0].click();
}
// If there are multiple - focus the first one
else if (candidates.length > 1) {
// Focus the first match
if (candidates.length) {
candidates[0].focus();
}
}
Expand Down

0 comments on commit b9c5c6b

Please sign in to comment.