fix: nested drawer onOpenChange issue #516
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This appears to fix the open issue
Nested drawer doesn't fire onOpenChange callback #457
And also allows for the nested drawer to be controlled independently via
nestedIsOpen
I noticed that the onOpenChange got removed in this commit
v0.9.2...v0.9.4#diff-0b5adbfe7b36e4ae2f479291e20152e33e940f7f265162d77f40f6bdb5da7405L1071
For my use case I also needed to open a nested drawer on route change, I've attached a short video to illustrate what I mean.
vaul.mp4
For info: to ensure that the parent drawer transitions correctly when the nested drawer is opened on route change I also needed to add this code
Maybe there is a cleaner way, but it seems to work.
Thought this fix might be useful to others.