Skip to content

[Dialog] v5 component renders even if open is false (different from v4)Β #35991

@sahanaravi

Description

@sahanaravi

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce πŸ•Ή

Link to live example:

Steps:
MUI5 - https://codesandbox.io/s/angry-mclaren-vgmhu6?file=/demo.tsx
1.Embed a Dialog in the code
2.Set it to open={false}
3.The dialog still renders in the DOM but is closed

MUI4- https://codesandbox.io/s/material-demo-forked-qm3dub?file=/demo.js
1.Embed a Dialog in the code
2.Set it to open={false}
3.The dialog does not render in the DOM

This has not been mentioned in the changes in the MUI5 document. This is breaking a few things in my app

Current behavior 😯

1.Embed a Dialog in the code
2.Set it to open={false}
3.The dialog still renders but is closed

Expected behavior πŸ€”

1.Embed a Dialog in the code
2.Set it to open={false}
3.The dialog should not render

Context πŸ”¦

ON upgrading from MUI4 to MUI5, the dialog behaviour changed causing issues

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Metadata

Metadata

Assignees

Labels

docsImprovements or additions to the documentation.scope: dialogChanges related to the dialog.v5.x

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions