angular / angular/components

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

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

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

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