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(matIcon): not inline well in Dialog Title #20637

Open
zijianhuang opened this issue Sep 23, 2020 · 3 comments
Open

bug(matIcon): not inline well in Dialog Title #20637

zijianhuang opened this issue Sep 23, 2020 · 3 comments
Labels
area: material/dialog P4 A relatively minor issue that is not relevant to core functions

Comments

@zijianhuang
Copy link

Reproduction

Use any StackBlitz link at https://material.angular.io/components/dialog/examples

Then past the following:

<h1 mat-dialog-title><mat-icon inline="true">error</mat-icon> Favorite Animal</h1>
<div mat-dialog-content>
  <h1>OOKK<mat-icon inline="true">error</mat-icon></h1>

Expected Behavior

automatically sizing the icon to match the font size of the element the icon is contained in.

Actual Behavior

Icon is rendered well in dialog content, but not in dialog title. And worse, the top and the bottom of the icon gets truncated a little bit.

Environment

  • Angular: 10.1.1
  • CDK/Material: 10.2.1
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@zijianhuang zijianhuang added the needs triage This issue needs to be triaged by the team label Sep 23, 2020
@crisbeto
Copy link
Member

I don't think that this is something that the dialog title was meant to do, but it seems like a reasonable request. Also it may be fixed in the MDC dialog implementation.

@crisbeto crisbeto added area: material/dialog Fixed in MDC P4 A relatively minor issue that is not relevant to core functions and removed needs triage This issue needs to be triaged by the team labels Sep 27, 2020
@zijianhuang
Copy link
Author

@crisbeto

Thanks for understanding. As described at https://material.io/components/dialogs#full-screen-dialog, icon is used in Title only with a button in full screen dialog.

Having a icon well supported in the title of small dialog will cover more complex business scenarios. I see it is an slight extension of Material Design, or in other words, Material Design does not discourage such application design.

Thanks again.

@amysorto
Copy link
Contributor

Currently does not work with the MDC based dialog and icon components but would be a good thing to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/dialog P4 A relatively minor issue that is not relevant to core functions
3 participants