From b9c5c6ba1506880a30b0dd0e9008f5161b67be73 Mon Sep 17 00:00:00 2001 From: Bogdan Abaev Date: Thu, 10 Oct 2024 12:04:36 -0700 Subject: [PATCH] never click on candidate from typing, just focus --- src/common/components/context-menu.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/common/components/context-menu.js b/src/common/components/context-menu.js index 931eb340..a7e01368 100644 --- a/src/common/components/context-menu.js +++ b/src/common/components/context-menu.js @@ -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(); } }