Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
cometaRobertillo opened this issue Jul 5, 2024 · 2 comments
Open
1 task done

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

cometaRobertillo opened this issue Jul 5, 2024 · 2 comments
Labels
area: material/dialog P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@cometaRobertillo
Copy link

Is this a regression?

  • 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
@cometaRobertillo cometaRobertillo added the needs triage This issue needs to be triaged by the team label Jul 5, 2024
@crisbeto
Copy link
Member

crisbeto commented Jul 5, 2024

You need to change the maxWidth in the dialog config, instead of the width.

@crisbeto crisbeto closed this as completed Jul 5, 2024
@cometaRobertillo
Copy link
Author

cometaRobertillo commented Jul 5, 2024

Thanx for your answer but no that dosnt work properly, the dialog didnt center correctly. Look

this is how it looks when you overwrite using this

.cdk-overlay-pane.mat-mdc-dialog-panel {
max-width: 100% !important;
}
image

and this is how it looks when you change maxWidth at the config.
image

same value 100% but didnt work well, the dialog get like left: 0 by default always when you use config. i recently update from v14 to 18

@crisbeto crisbeto reopened this Jul 5, 2024
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/dialog and removed needs triage This issue needs to be triaged by the team labels Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/dialog P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

2 participants