diff --git a/packages/nicolium/src/features/ui/components/hotkeys.tsx b/packages/nicolium/src/features/ui/components/hotkeys.tsx index ec70798cd..d1029ef1a 100644 --- a/packages/nicolium/src/features/ui/components/hotkeys.tsx +++ b/packages/nicolium/src/features/ui/components/hotkeys.tsx @@ -216,9 +216,9 @@ function useHotkeys(handlers: HandlerMap) { }); // Sort all matches by priority - matchCandidates.toSorted((a, b) => b.priority - a.priority); + const sortedCandidates = matchCandidates.toSorted((a, b) => b.priority - a.priority); - const bestMatchingHandler = matchCandidates.at(0)?.handler; + const bestMatchingHandler = sortedCandidates.at(0)?.handler; if (bestMatchingHandler) { const result = bestMatchingHandler(event); if (result !== false) {