angular / angular/components

Feature Request : Mat-Tab select by name.

Aperta
#11,858 9 commenti 19 reazioni 0 assegnatari Vedi su GitHub
area: material/tabs feature P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

#### Bug, feature request, or proposal:
Feature Request for material tabs

#### What is the expected behavior?
The ability to select a tab by its name, like this;

``

``

#### What is the current behavior?
``

#### What is the use-case or motivation for changing an existing behavior?

I am using the material tabs in a responsive app. When the app is in mobile size I display 5 tabs, when the app is in desktop size I display 3 tabs. The reason is since there is more room on the desktop I combine the content and show less tabs.

The issue is when I try to link to a specific tab via a URL. I would use a query parameter like ?tabindex=2. However since my tab index changes depending on the application size, the link will work in one case and not the other. So it would be useful to link to the tab by name like this, ?tab=profile. This way I can pass the name to the component and it can figure out the active tab regardless of the index number.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dai punti di ingresso mat-tab-group e mat-tab descritti nell’issue e verifica come selectedIndex controlla attualmente la scheda attiva. Definisci come dovrebbe comportarsi un’API di selezione basata sul nome quando le schede vengono visualizzate o combinate in modo responsive, quindi verifica che un URL come ?tab=profile selezioni la scheda prevista indipendentemente dal suo indice.

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

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.