Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only prevent keys that don't have a modifier attached
Browse files Browse the repository at this point in the history
bkrmendy committed Jul 11, 2024
1 parent 48f62f7 commit 183fe3c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion editor/src/uuiui/radix-components.tsx
Original file line number Diff line number Diff line change
@@ -47,7 +47,12 @@ export interface DropdownMenuProps {
}

export const DropdownMenu = React.memo<DropdownMenuProps>((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)

0 comments on commit 183fe3c

Please sign in to comment.