Skip to content

[dialog] portal stays "mounted" when popup is removed #2186

Open
@KingSora

Description

@KingSora

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions