angular / angular/components

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

Ouverte
#30,375 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area: material/tabs P2
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par l’implémentation des tabs d’Angular Material et le mixin tabs-overrides, en suivant le chemin fitInkBarToContent et les styles de active-indicator sur .mat-mdc-tab-header. C’est terminé lorsque cette entrée produit un active indicator de 3px avec une forme de 3px 3px 0 0, conforme à l’attente indiquée de Material 3.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, scss, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.