Skip to content

Commit

Permalink
fix: stop propagation on dialog backdrop click (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Apr 28, 2023
1 parent 8ac8733 commit 46f04c5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/modal/useDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function useDialog({

const onClick = useCallback<MouseEventHandler<HTMLDialogElement>>(
(event) => {
event.stopPropagation();
// Since the dialog has no size of itself, this condition is only
// `true` when we click on the backdrop.
if (event.target === event.currentTarget && requestCloseOnBackdrop) {
Expand Down

0 comments on commit 46f04c5

Please sign in to comment.