From 183fe3ce4895b9538f24db29d203601674ab529f Mon Sep 17 00:00:00 2001 From: Berci Kormendy Date: Thu, 11 Jul 2024 12:55:14 +0200 Subject: [PATCH] only prevent keys that don't have a modifier attached --- editor/src/uuiui/radix-components.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/src/uuiui/radix-components.tsx b/editor/src/uuiui/radix-components.tsx index 4ad179648034..5908f134de4e 100644 --- a/editor/src/uuiui/radix-components.tsx +++ b/editor/src/uuiui/radix-components.tsx @@ -47,7 +47,12 @@ export interface DropdownMenuProps { } export const DropdownMenu = React.memo((props) => { - const stopPropagation = React.useCallback((e: React.KeyboardEvent) => e.stopPropagation(), []) + const stopPropagation = React.useCallback((e: React.KeyboardEvent) => { + const hasModifiers = e.altKey || e.metaKey || e.shiftKey || e.ctrlKey + if (!hasModifiers) { + e.stopPropagation() + } + }, []) const onEscapeKeyDown = React.useCallback((e: KeyboardEvent) => e.stopPropagation(), []) const [open, onOpen] = React.useState(false)