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): The margin in v15.0 is broken #26082

Closed
1 task done
zijianhuang opened this issue Nov 24, 2022 · 4 comments
Closed
1 task done

bug(dialog): The margin in v15.0 is broken #26082

zijianhuang opened this issue Nov 24, 2022 · 4 comments
Assignees
Labels
needs triage This issue needs to be triaged by the team

Comments

@zijianhuang
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

14,13,12

Description

The margins of content are too narrow to the borders. I have tried 4 prebuilt themes, the results are the same.

Reproduction

Steps to reproduce:

  1. Go to https://material.angular.io/components/dialog/overview, and click any dialog example

Expected Behavior

go to https://material.angular.io/components/dialog/overview then switch to v14, v13 etc.

Actual Behavior

Ugly dialog with too narrow margins of content to the borders.

Environment

  • Angular: 15.0 or 15.0.1
  • CDK/Material: 15.0
  • Browser(s): Chrome and Firefox
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@zijianhuang zijianhuang added the needs triage This issue needs to be triaged by the team label Nov 24, 2022
@geromegrignon
Copy link
Contributor

Hi @zijianhuang, that's more likely due to MDC migration.
However, the current behavior matches Material Design specs: https://m2.material.io/components/dialogs#theming

@RobinKamps
Copy link

The design spec changed the padding for the dialog-action (8px padding instead of 24px).
The action-padding (or action button alignment) can be overwritten in global styles easily,to fit the projects needs - e.g. :

.mat-mdc-dialog-actions {
  justify-content: center !important;
}

However @zijianhuang has a point: the dialog content does not match the material design spec, because the inner div boxing size is not correct (exceeding to the right, not matching the material design padding right), at least for mat-form-fields without additional wrapper divs or styling:

image

@amysorto amysorto self-assigned this Dec 1, 2022
@amysorto
Copy link
Contributor

amysorto commented Dec 1, 2022

The MDC based dialog follows the material spec as pointed out by @geromegrignon. So I'll be closing this issue.

@RobinKamps thanks for pointing out that example! The width was set to 250px in the demo, the default width does not cut off the form-field. I removed it in #26157.

@amysorto amysorto closed this as completed Dec 1, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests

4 participants