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(material/button): mat-icon-button has different display on anchor and button #26126

Closed
1 task
DaSchTour opened this issue Nov 29, 2022 · 4 comments · Fixed by #26146
Closed
1 task

bug(material/button): mat-icon-button has different display on anchor and button #26126

DaSchTour opened this issue Nov 29, 2022 · 4 comments · Fixed by #26146
Assignees
Labels
area: material/button P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@DaSchTour
Copy link
Contributor

DaSchTour commented Nov 29, 2022

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

No response

Description

I use FontAwesome Icons with Material and with version 15 discovered a lot of issues with icons.
One for which I could create a reproduction is a different display between <a mat-icon-button></a> and <button mat-icon-button></button>

Reproduction

https://angular-ivy-dgra38.stackblitz.io

Expected Behavior

The icon position is the same for anchor and button

Actual Behavior

The anchor is positioned to the left

Environment

  • Angular: 15.0.1
  • CDK/Material: 15.0.0
  • Browser(s): Chrome
@DaSchTour DaSchTour added the needs triage This issue needs to be triaged by the team label Nov 29, 2022
@DaSchTour
Copy link
Contributor Author

Additionally a <a mat-icon-button></a> inside mat-toolbar is shifted to the bottom. Also added this to the stackblitz above.

@crisbeto crisbeto self-assigned this Dec 1, 2022
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent has pr area: material/button and removed needs triage This issue needs to be triaged by the team labels Dec 1, 2022
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 1, 2022
Fixes that SVG icons sometimes weren't centered in an icon button.

Fixes angular#26126.
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 1, 2022
Fixes that SVG icons sometimes weren't centered in an icon button.

Fixes angular#26126.
@crisbeto
Copy link
Member

crisbeto commented Dec 1, 2022

I've opened #26146 which should resolve most of the inconsistencies, but I wanted to note that your example is mixing mat-icon and fa-icon. Since we don't own the latter, we can't guarantee that it'll align exactly the the Material icons.

@DaSchTour
Copy link
Contributor Author

Yes I know. But I'm currently experimenting which of them work better. mat-icon worked fine with the SVG in v14 but it's extremely hard do adjust in v15 to look good and be correctly aligned.

crisbeto added a commit that referenced this issue Dec 1, 2022
Fixes that SVG icons sometimes weren't centered in an icon button.

Fixes #26126.
crisbeto added a commit that referenced this issue Dec 1, 2022
Fixes that SVG icons sometimes weren't centered in an icon button.

Fixes #26126.

(cherry picked from commit 1d2d7e1)
wagnermaciel pushed a commit to wagnermaciel/components that referenced this issue Dec 9, 2022
Fixes that SVG icons sometimes weren't centered in an icon button.

Fixes angular#26126.
@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
area: material/button P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants