Skip to content

Commit

Permalink
fix: disable pointerDownOutside trigger onDismiss (#1215)
Browse files Browse the repository at this point in the history
* fix: multiple listening modal event

* Revert "fix: multiple listening modal event"

This reverts commit 86c3323.

* fix: preventDefault PointerDownOutside
  • Loading branch information
Debbl authored Oct 29, 2024
1 parent e558591 commit 2bf5245
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions apps/renderer/src/components/ui/modal/stacked/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,12 @@ export const ModalInternal = memo(
<Dialog.Portal>
{Overlay}
<Dialog.DialogTitle className="sr-only">{title}</Dialog.DialogTitle>
<Dialog.Content asChild aria-describedby={undefined} onOpenAutoFocus={openAutoFocus}>
<Dialog.Content
asChild
aria-describedby={undefined}
onPointerDownOutside={(event) => event.preventDefault()}
onOpenAutoFocus={openAutoFocus}
>
<div
ref={setEdgeElementRef}
className={cn(
Expand Down Expand Up @@ -281,7 +286,12 @@ export const ModalInternal = memo(
<Dialog.Root modal={modal} open onOpenChange={onClose}>
<Dialog.Portal>
{Overlay}
<Dialog.Content asChild aria-describedby={undefined} onOpenAutoFocus={openAutoFocus}>
<Dialog.Content
asChild
aria-describedby={undefined}
onPointerDownOutside={(event) => event.preventDefault()}
onOpenAutoFocus={openAutoFocus}
>
<div
ref={setEdgeElementRef}
className={cn(
Expand Down

0 comments on commit 2bf5245

Please sign in to comment.