Skip to content

[drawer] Dialog inside a drawer is registered as a nested drawer #4492

@green-mint

Description

@green-mint

Bug report

Current behavior

In the nested drawers example, if the last nested Drawer is replaced with a Dialog, opening that dialog causes the parent drawer stack to behave as if another drawer was opened.

Repro structure:

Drawer -> Drawer -> Dialog

When the dialog opens from inside the second drawer:

  • the first drawer's nested-stack animation runs again
  • the --nested-drawers CSS variable increments

This makes it look like the dialog is being registered as a nested drawer.

Expected behavior

Opening a Dialog inside a nested Drawer should not affect drawer nesting state.

The parent drawers should remain visually stable, and --nested-drawers should not increment when the dialog opens.

Reproducible example

https://stackblitz.com/edit/xgcvvskx?file=src%2FApp.tsx

Base UI version

v1.3.0

Which browser are you using?

Chrome

Which OS are you using?

Mac OS

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: drawerChanges related to the drawer component.type: bugIt doesn't behave as expected.
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions