angular / angular/components

bug(TABS): tabs with fitInkBarToContent does not follow Material 3 design specs

Offen
#30,375 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/tabs P2
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

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

As per [Material 3 guidelines](https://m3.material.io/components/tabs/specs), primary tabs should have active indicator's height of `3px` and shape of `3px 3px 0 0`. In Angular Material, primary tabs' behaviour can be achieved using `[fitInkBarToContent]=true` input.

But, they have height of `2px`, and shape of `0`, which is right only for secondary tabs.

We can override it by using `tabs-overrides` mixin like below:

```scss
@use '@angular/material' as mat;

[fitInkBarToContent],
[ng-reflect-fit-ink-bar-to-content='true'] {
> .mat-mdc-tab-header {
@include mat.tabs-overrides(
(
active-indicator-shape: 3px 3px 0 0,
active-indicator-height: 3px,
)
);
}
}
```

But, it should be the default behaviour as per Material 3 specs.

### Reproduction

Not needed.

### Expected Behavior

Tabs with `[fitInkBarToContent]=true` should have active indicator's height of `3px` and shape of `3px 3px 0 0`.

### Actual Behavior

Tabs with `[fitInkBarToContent]=true` have active indicator's height of `2px`, and shape of `0`.

### Environment

- Angular: 19
- CDK/Material: 19
- Browser(s): Edge
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie bei der Tabs-Implementierung von Angular Material und dem tabs-overrides mixin und verfolgen Sie den fitInkBarToContent-Pfad sowie die active-indicator-Stile auf .mat-mdc-tab-header. Als abgeschlossen gilt, wenn diese Eingabe einen 3px active indicator mit einer Form von 3px 3px 0 0 erzeugt, entsprechend der angegebenen Material 3-Erwartung.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, scss, typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.