proposal
Let the user define some "id" for the tab, to identify, outside the tab container, which tab is currently selected. Please note that this id may not necessarily be a substitute to the "selectedIndex" property, but some aditional content to identify which tab is currently selected.
Today we can only know which tab is selected using the selectedIndex
of md-tab-group
, which is not really safe as the content of the tab may be changed and the index changes within it
This is linked to #4135. The "workaround" that I found to use a "fixed" content relative to the current selected tab is to render the fixed element outside the tab-group and use the selectedIndex
to show it.
2.0.0-beta.3
This would be great to have that because if you protect your tab with ngIf the index is not always the Same.
The id property should be provided in the current available events.
This would definitely be useful when programmatically setting the tab.
i also want set the tab programmatically +1
@finalxcode I am not saying it is a great solution but I have been programmatically selecting based on index.
I need this for e2e Tests
We need this because we have cases where some tabs are hidden with *ngIf, so the index is not reliable.
Very valid request! Its really needed!
any update guys?. I need this feature. it helps us to fix the e2e pipeline
Is there any progress on this feature request?
e2e testing is a nightmare because of this. I feel like I'm better off not using material components.
This issue is already 3 years old. Common guys, just make it happen already...
Would be nice indeed to be able to add some, for example, data-testid
attributes to the DOM
Yeah, we need to be able to add some sort of attributes here, just ran into this now...
Most helpful comment
This issue is already 3 years old. Common guys, just make it happen already...