Toggle locked for uncontrolled dialogs
This commit is contained in:
parent
82d1d7550a
commit
a18c4d88bb
1 changed files with 3 additions and 0 deletions
|
|
@ -23,6 +23,9 @@ export const Dialog = ({ children, ...props }: PropsWithChildren<Props>) => {
|
|||
|
||||
function handleOpenChange(open: boolean) {
|
||||
if (props.onOpenChange) props.onOpenChange(open)
|
||||
if (props.open === undefined) {
|
||||
toggleLocked(open)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue