Skip to content

Commit

Permalink
do not propagate esc
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrmendy committed Jul 11, 2024
1 parent 21d500a commit 48f62f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions editor/src/uuiui/radix-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface DropdownMenuProps {

export const DropdownMenu = React.memo<DropdownMenuProps>((props) => {
const stopPropagation = React.useCallback((e: React.KeyboardEvent) => e.stopPropagation(), [])
const onEscapeKeyDown = React.useCallback((e: KeyboardEvent) => e.stopPropagation(), [])

const [open, onOpen] = React.useState(false)

Expand All @@ -62,6 +63,7 @@ export const DropdownMenu = React.memo<DropdownMenuProps>((props) => {
<RadixDropdownMenu.Portal>
<RadixDropdownContent
onKeyDown={stopPropagation}
onEscapeKeyDown={onEscapeKeyDown}
sideOffset={props.sideOffset}
collisionPadding={{ top: -4 }}
align='start'
Expand Down

0 comments on commit 48f62f7

Please sign in to comment.