bug(material/button): incorrect alignment of svg icons
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
### 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
20.0.5
### Description
After update to angular/material 20.1.+
Material buttons with icons no longer align properly.
_________________________________________
**Before**
**After**
_________________________________________
**What causing an issue?**
After removing `min-height`, everything works as before.
My icon size is 24px, but with `min-height: fit-content`, the .mat-icon container gets stretched while the SVG icon remains the same size.
For example:
- `.mat-icon: 24px × 29px`
- `svg: 24px × 24px`
This causes vertical misalignment of icons compared to previous versions.
I believe this PR is the cause of this issue.: https://github.com/angular/components/pull/30891
commit -> https://github.com/angular/components/pull/30891/commits/87b6962841454cfde8200b9c9de7ad73079416ae
_________________________________________
### Reproduction
StackBlitz link:
Steps to reproduce:
1.
2.
### Expected Behavior
The `.mat-icon` inside `.mat-mdc-button-base` should remain properly aligned and not stretch vertically.
The mat-icon container should match the size of the SVG icon `(24px × 24px)` when the icon size is set to `24px`.
### Actual Behavior
With `min-height: fit-content;` applied, the .mat-icon container stretches vertically `(e.g., 24px × 29px) `while the SVG icon stays 24px × 24px.
This causes misalignment and extra spacing around the icon compared to previous versions.
### Environment
- Angular: 20.1.2
- CDK/Material: 20.1.2
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS
コントリビューションガイド
調査の方向性
`.mat-mdc-button-base` と `.mat-icon` 周辺の Angular Material のボタンスタイルを確認し、PR 30891 の commit 87b6962841454cfde8200b9c9de7ad73079416ae で導入された動作をバージョン 20.0.5 と比較します。Angular/Material 20.1.2 で 24px の SVG アイコンを使って再現し、コンテナが 24px × 24px のままであり、アイコンが垂直方向に整列されることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, css, typescript
- 領域
- frontend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100