[dialog] portal stays "mounted" when popup is removed
- Dominant language
- TypeScript
- Stars
- 10.9k
- Forks
- 543
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 101
Description
# Bug report
Its a bit hard to explain, but I've created an example here: https://codesandbox.io/p/devbox/pedantic-grass-22zl8v?workspaceId=ws_9E7g8meGhxx9KyReSrgWiy
Steps to reproduce:
- Create a dialog where the `Dialog.Popup` is dynamically rendered depending on the `open` state
- When the dialog is dismissed and the `Dialog.Popup` is switched out with anything else (in the examle its `null`)
- After the `Dialog.Popup` disappears the `Dialog.Portal` stays around indefinitely
## Current behavior
The `Dialog.Portal` stays around even when the `Dialog.Popup` is gone and thus no transition / animation can occur to unmount the `Dialog.Popup`.
## Expected behavior
The `Dialog.Portal` should not wait for any animations to complete when there is no `Dialog.Popup` to perform any animations.
## Reproducible example
https://codesandbox.io/p/devbox/pedantic-grass-22zl8v?workspaceId=ws_9E7g8meGhxx9KyReSrgWiy
## Base UI version
1.0.0-beta.0
## Which browser are you using?
Firefox 139.0.4 (64-Bit)
## Which OS are you using?
Windows 11
## Additional context
Provide any additional context that might help us identify the problem and find a solution.
Contributor guide
Assessment
This issue has not been assessed yet.