angular / angular/components

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

Offen
#29,384 7 Kommentare 10 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/dialog P3
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

### 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, das Problem mit der width-Einstellung von Angular Material's MatDialogConfig zu reproduzieren, und untersuche die im Bericht beschriebene max-width-Regel von .cdk-overlay-pane.mat-mdc-dialog-panel. Vergleiche das aktuelle Verhalten bei der Dialoggröße mit der vorherigen Version; als erledigt gilt die Aufgabe, wenn die Dialogbreite auf den konfigurierten Wert und den Inhalt der Komponente reagiert, ohne einen globalen !important-Override zu erfordern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, css, typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
58/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.