angular / angular/components

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

Đang mở
#29,384 7 bình luận 10 reaction 0 người được giao Xem trên GitHub
area: material/dialog P3
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện vấn đề với thiết lập width của Angular Material's MatDialogConfig và kiểm tra quy tắc max-width của .cdk-overlay-pane.mat-mdc-dialog-panel được mô tả trong báo cáo. So sánh hành vi định kích thước hộp thoại hiện tại với phiên bản trước; được xem là hoàn tất khi chiều rộng hộp thoại phản hồi theo giá trị đã cấu hình và nội dung của component mà không cần một override toàn cục với !important.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, css, typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
58/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.