Skip to content

[dialog] Body scrollbar is overlapping when nesting Dialogs #46984

@MasterProvider

Description

@MasterProvider

Steps to reproduce

Steps:

  1. Open this link to live example: https://codesandbox.io/p/sandbox/modern-moon-ntps8w
  2. Click the edit icon to open the activity
  3. In activity click update to open Inner Dialog

Current behavior

When opening a nested (inner) Dialog inside a fullscreen outer Dialog, the scrollbar behavior becomes inconsistent.

Opening the inner Dialog causes a body scrollbar to appear.

After closing the inner Dialog, the fullscreen outer Dialog overlaps with the scrollbar, causing layout shifting / scrollbar overlay issues.

Expected behavior

Opening or closing the inner Dialog should not cause the fullscreen outer Dialog to overlap with the body scrollbar.

When the inner Dialog is opened, the scrollbar should be hidden.
When the inner Dialog is closed, the fullscreen Dialog should not overlap with the body scrollbar or cause layout shifts.

Context

No response

Your environment

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

Search keywords: Dialog

Metadata

Metadata

Labels

scope: dialogChanges related to the dialog.type: bugIt doesn't behave as expected.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions