Identifier property for TabPanel to enable tab based routing
I'm submitting a ... (check one with "x")
[ ] bug report => Search github for a similar issue or PR before submitting
[x] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Current behavior TabView component exposes 'activeIndex' to programmatically control the currently selected tab.
Expected behavior An identifier property for TabPanel component to control the selected tab based on the identifier rather than the index of the tab as the index of the tabs can change in various scenarios.
What is the motivation / use case for changing the behavior? The identifier would enable URL fragment based navigation for tabs. Currently routing for tabs cannot be done without hacks.
Another use case could be this - https://forum.primefaces.org/viewtopic.php?f=35&t=52239&p=159502&hilit=tabpanel#p159502
-
Angular version: 4.3.6
-
PrimeNG version: 4.2.1
-
Language: [TypeScript 2.3.0]
This functionality will help to deal with applications where users have the ability to create or delete tabs on demand.
The activeIndex is not very helpful and also we cannot rely on tab Names, in a localized application.
+1
If, say, certain tabs are in *ngIfs, there's no obvious way to know the index of a particular tab.
one solution to overcome the problem is to rely on a directive that extends the tabview with converting the active index to a query string name, keeping into account the hidden panels along the way code https://stackblitz.com/edit/primeng-issues-tabview-name sample https://primeng-issues-tabview-name.stackblitz.io/?tab=three
This would be nice, we wouldn't have to make hacks.
Hi,
So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!
Best Regards,