[Dialog] Support non-nested modal dialogs #1320
Labels
component: dialog
This is the name of the generic UI component, not the React module!
new feature
New feature or request
Bug report
Current behavior
Rendering several non-nested modal dialogs simultaneously causes issues. See the attached video and demo.
Kapture.2025-01-09.at.15.12.38.mp4
In order to have two or more well-functioning modal dialogs opened at the same time, users need to nest them:
This is very limiting and users will expect to be able to open several dialogs at the same time without nesting them in the component tree:
Expected behavior
Like other libraries, users should be able to render several dialogs simultaneously without needing to nest them. Radix and other libraries support this: https://codesandbox.io/p/sandbox/radix-dialog-nested-without-nesting-jvvlrn?file=/src/App.tsx&workspaceId=ws_HE9JRzFW36Y2kpBoSwdvZ5
Reproducible example
Base UI version
v1.0.0-alpha.5
Additional context
Currently,
data-nested
,data-has-nested-dialogs
, and--nested-dialogs
are only functional when nesting dialogs in JSX. Having to nest dialogs in JSX is a big constraint for users (e.g., programmatically opened dialogs). While working on this issue, the team could think about allowing users to style dialogs usingdata-nested
,data-has-nested-dialogs
, and--nested-dialogs
without actually nesting them in JSX.The text was updated successfully, but these errors were encountered: