Skip to content

[material-ui][Dialog] maxWidth exceeds in v6 #43636

@joshkel

Description

@joshkel

Steps to reproduce

Link to live example: https://stackblitz.com/edit/react-koqgrc?file=Demo.tsx

Steps:

  1. Click the button to open the dialog.

Current behavior

The dialog is wider than the available screen space and is not scrollable, even though it's specified maxWidth="sm".

Expected behavior

The dialog should limit itself to the specified maxWidth, and since this content is too wide, it should scroll.

Context

This is a regression in v6 and is the same root cause as #43572 - the overflowY: 'auto' that was removed was also implicitly setting overflowX: 'auto'. Therefore, #43626 should also fix this issue.

Your environment

npx @mui/envinfo
  System:
    OS: macOS 14.6.1
  Binaries:
    Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v18.20.2/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 128.0.6613.120 (active)
    Edge: 128.0.2739.67
    Safari: 17.6
  npmPackages:
    @emotion/react:  11.13.3
    @emotion/styled:  11.13.0
    @mui/base:  5.0.0-beta.58
    @mui/core-downloads-tracker:  6.0.1
    @mui/icons-material:  6.0.1
    @mui/lab:  6.0.0-beta.8
    @mui/material:  6.0.1
    @mui/private-theming:  6.0.1
    @mui/styled-engine:  6.0.1
    @mui/system:  6.0.1
    @mui/types:  7.2.16
    @mui/utils:  6.0.1
    @mui/x-date-pickers:  7.15.0
    @mui/x-internals:  7.15.0
    @mui/x-tree-view:  7.15.0
    @types/react: ^18.3.5 => 18.3.5
    react: ^18.3.1 => 18.3.1
    react-dom: ^18.3.1 => 18.3.1
    typescript: ^5.5.4 => 5.5.4

Search keywords: Dialog maxWidth

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: dialogChanges related to the dialog.type: regressionA bug, but worse, it used to behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions