angular / angular/components

bug(mat-button-toggle): mat-button-toggle is 2px too tall

オープン
#30,405 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area: material/button-toggle P4
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### 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

A `mat-button-toggle` is 2px taller than a `mat-stroked-button` despite both `--mat-standard-button-toggle-height` and `--mdc-outlined-button-container-height` both defaulting to 40px.

![Image](https://github.com/user-attachments/assets/fa897af5-2db7-46d0-8e65-c4531a46404b)
(this screenshot is at 2x zoom; each grid square is 2px)

### Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-starter-bqkpddq3?file=src%2Fmain.ts

### Expected Behavior

`mat-stroked-button` and `mat-button-toggle` have the same height

### Actual Behavior

`mat-button-toggle` is 2px taller than `mat-stroked-button`

### Environment

```
> ng version

_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/

Angular CLI: 18.2.8
Node: 18.20.3
Package Manager: npm 10.2.3
OS: linux x64

Angular: 18.2.8
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, platform-browser, router

Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1802.9
@angular-devkit/build-angular 18.2.9
@angular-devkit/core 18.2.9
@angular-devkit/schematics 18.2.8
@schematics/angular 18.2.8
rxjs 7.8.1
typescript 5.5.4
zone.js 0.14.10
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

src/main.ts の StackBlitz 再現から始め、報告された Angular バージョンで mat-button-toggle と mat-stroked-button を比較します。2 つのコンポーネントのレンダリング後の高さを追跡し、再現で示されているように両方のコントロールの高さが同じであることを確認して修正を検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。