Skip to content
Discussion options

You must be logged in to vote

Short answers in order:

1. setOpen(false) → onOpenChangeComplete(false) → router.back(): yes, that's the right shape for UI-initiated dismissal. The popup stays mounted through the exit animation and onOpenChangeComplete only fires once it has finished, so navigating there is what keeps the animation intact. Browser Back is the case where the route unmounts first and you just don't get an exit animation. That's fine, and nothing calls router.back() twice because the component is already gone.

2. Scroll lock during the exit: there's no prop for it. In Base UI the lock is literally

// packages/react/src/dialog/root/useDialogRoot.ts
useScrollLock(open && modal === true, popupElement);

so it'…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alekseykurylev
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