angular / angular/components

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

Aperta
#30,405 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area: material/button-toggle P4
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con la riproduzione StackBlitz in src/main.ts e confronta mat-button-toggle con mat-stroked-button nelle versioni di Angular segnalate. Traccia le altezze renderizzate dei due componenti e verifica la correzione confermando che entrambi i controlli abbiano la stessa altezza mostrata nella riproduzione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.