-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
P5The team acknowledges the request but does not plan to address it, it remains open for discussionThe team acknowledges the request but does not plan to address it, it remains open for discussionarea: material/tabsfeatureThis issue represents a new feature or feature request rather than a bug or bug fixThis issue represents a new feature or feature request rather than a bug or bug fixhelp wantedThe team would appreciate a PR from the community to address this issueThe team would appreciate a PR from the community to address this issue
Description
Feature request
Add uniqueName
to mat-tab
in Tabs
What is the expected behavior?
- Add the ability to specify a
uniqueName
permat-tab
in Tabs as anInput()
or programmatically usingMatTab
- Add the
uniqueName
property toMatTab
anywhere this is accessible includingMatTabChangeEvent.tab.uniqueName
for all@Output
events that are of typeEventEmitter<MatTabChangeEvent>
What is the current behavior?
This is currently not available.
What are the steps to reproduce?
Nothing to reproduce, not currently available.
What is the use-case or motivation for changing an existing behavior?
The only way to see which tab was activated/changed in a handler for selectedTabChange
is to use the event tab's index. If the developer wants to execute a specific action per activated tab like preloading data (as one example) the system must be able to identify exactly which tab was selected. This can be cumbersome for multiple reasons.
- If tabs are dynamically hidden from view using
*ngIf
conditions the tab's index assignments shift making it difficult to know which tab was activated unless the event handler also checks all the conditions. - If the UI changes and the tabs are re-ordered (as a part of a design change) the event handler must also be updated so that any logic based on selected tab is also updated to reflect the new UI order.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular CLI: 7.0.3
Node: 10.13.0
OS: win32 x64
Angular: 7.0.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 7.0.3
@angular/cdk 7.0.2
@angular/cli 7.0.3
@angular/material 7.0.2
@ngtools/webpack 6.0.8
@schematics/angular 7.0.3
@schematics/update 0.10.3
rxjs 6.3.3
typescript 3.1.3
webpack 4.8.3
Is there anything else we should know?
I might have forgotten an additional point of where you can set or read back the value. I wrote this based on the documentation, please use your own judgment and add it in any necessary additional locations if deemed appropriate.
sielver, Jeto143, lebesnec, LanderBeeuwsaert and IgorWolbers
Metadata
Metadata
Assignees
Labels
P5The team acknowledges the request but does not plan to address it, it remains open for discussionThe team acknowledges the request but does not plan to address it, it remains open for discussionarea: material/tabsfeatureThis issue represents a new feature or feature request rather than a bug or bug fixThis issue represents a new feature or feature request rather than a bug or bug fixhelp wantedThe team would appreciate a PR from the community to address this issueThe team would appreciate a PR from the community to address this issue