angular / angular/components

Option to have no tab selected in mat-tab-group

Aperta
#18,316 12 commenti 18 reazioni 0 assegnatari Vedi su GitHub
area: material/tabs feature G P4
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

#### Feature Description

Allow MatTabGroup to have a state where no tab is selected/active. The current behavior always has a tab selected/active.

Currently, MatTabGroup has a selectedIndex property with type number | null, but setting it to null does not unselect any of the tabs; the first tab is selected/active by default. I think that it would be more intuitive if setting selectedIndex to null unselected all of the tabs.

#### Use Case

Adding this feature would allow for a tab group to be in a collapsed state where no tab is selected and only the header is visible. Clicking one of the tabs in the header would then set the selected tab, the current behavior. This would provide more flexibility in using tabs for a layout.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start at the MatTabGroup selectedIndex handling and read the existing tab-selection tests. Verify how a null selectedIndex is treated, then define the completed behavior as allowing no tab to be active while preserving header clicks that select a tab.

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

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.