Skip to content

Commit

Permalink
docs(dialog): tell user when backdropClose works (#3272)
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsnes authored Mar 3, 2025
1 parent b6c60a0 commit 4e20848
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/react/src/components/Dialog/Dialog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const dialogRef = useRef<HTMLDialogElement>(null);
### Close on backdrop click

Vi bruker `backdropClose={true}` proppen for å lukke dialogen når brukeren klikker utenfor.
Dette funker kun dersom du har `modal={true}`, fordi en non-modla har ikke et backdrop.

<Canvas of={DialogStories.BackdropClose} />

Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export type DialogProps = MergeRight<
closeButton?: string | false;
/**
* Close on backdrop click.
* Only works when `modal` is true.
*
* @default false
*/
backdropClose?: boolean;
Expand Down

0 comments on commit 4e20848

Please sign in to comment.