angular / angular/components

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

Abierto
#18,316 12 comentarios 18 reacciones 0 asignados Ver en GitHub
area: material/tabs feature G P4
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
frontend
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.