From 395553bc6be4c9cf06f97287e1646caafa746a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Thu, 5 Mar 2026 10:49:41 +0100 Subject: [PATCH] nicolium: allow hotkeys to continue propagating MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- .../nicolium/src/features/ui/components/hotkeys.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/nicolium/src/features/ui/components/hotkeys.tsx b/packages/nicolium/src/features/ui/components/hotkeys.tsx index 89fb67241..ec70798cd 100644 --- a/packages/nicolium/src/features/ui/components/hotkeys.tsx +++ b/packages/nicolium/src/features/ui/components/hotkeys.tsx @@ -200,7 +200,7 @@ function useHotkeys(handlers: HandlerMap) { const matchCandidates: { // A candidate will be have an undefined handler if it's matched, // but handled in a parent component rather than this one. - handler: ((event: KeyboardEvent) => void) | undefined; + handler: ((event: KeyboardEvent) => void | boolean) | undefined; priority: number; }[] = []; @@ -220,9 +220,11 @@ function useHotkeys(handlers: HandlerMap) { const bestMatchingHandler = matchCandidates.at(0)?.handler; if (bestMatchingHandler) { - bestMatchingHandler(event); - event.stopPropagation(); - event.preventDefault(); + const result = bestMatchingHandler(event); + if (result !== false) { + event.stopPropagation(); + event.preventDefault(); + } } // Add last keypress to buffer