angular / angular/components

Bug(Dialog): Dialog size is fixed and can't be changed

Open
#29,384 7 comments 10 reactions 0 assignees View on GitHub
area: material/dialog P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### Is this a regression?

- [X] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

16-

### Description

Exist a property that make all dialogs appear at the same exact size at this class:

.cdk-overlay-pane.mat-mdc-dialog-panel
max-width: var(--mat-dialog-container-max-width, 80vw);

If you replace it with this at style.scss now it works fine and resize based on your elements
.cdk-overlay-pane.mat-mdc-dialog-panel {
max-width: 100% !important;
}

### Reproduction

StackBlitz link: No link
Steps to reproduce:
1. use a dialog and try change your modal size using dialog config ex. width: '100%'

const dialogConfig: MatDialogConfig = {
hasBackdrop: true,
disableClose: true,
width: '100%'
};

At past versions it dosnt matter, resize based on your styles and structure.

### Expected Behavior

Dialog resize based on component structure

### Actual Behavior

Dialog size appear fixed and can't change base on component elements

### Environment

- Angular: 18.0.3
- CDK/Material: 18.0.3
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 11

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with Angular Material's MatDialogConfig width setting and inspect the .cdk-overlay-pane.mat-mdc-dialog-panel max-width rule described in the report. Compare the current dialog sizing behavior with the previous version; done means dialog width responds to the configured value and component content without requiring a global !important override.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, css, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.