Feature Request : Mat-Tab select by name.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
#### 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.
Beitragsleitfaden
Rechercherichtung
Beginne bei den im Issue beschriebenen Einstiegspunkten mat-tab-group und mat-tab und überprüfe, wie selectedIndex derzeit das aktive Tab steuert. Lege fest, wie sich eine namensbasierte Auswahl-API verhalten soll, wenn Tabs responsiv angezeigt oder zusammengefasst werden, und verifiziere anschließend, dass eine URL wie ?tab=profile unabhängig von ihrem Index das vorgesehene Tab auswählt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, typescript
- Bereich
- frontend
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 30/100