Skip to content

Controlled Dialog and onOpenChange inconsistency #47

Answered by GiyoMoon
dannylin108 asked this question in Q&A

You must be logged in to vote

onOpenChange only gets called when corvu changes the open state internally. The purpose of this callback is to allow you to reflect state changes to your signal, if you directly edit your signal you don't have to be notified because your signal is already up to date. Normally you'd put setOpen inside onOpenChange to sync it:
<Dialog open={open()} onOpenChange={setOpen} />

Replies: 1 comment

You must be logged in to vote
0 replies
Answer selected by dannylin108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants