Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steps component does not support named routes #1222

Closed
codenomnom opened this issue Apr 29, 2021 · 1 comment
Closed

Steps component does not support named routes #1222

codenomnom opened this issue Apr 29, 2021 · 1 comment

Comments

@codenomnom
Copy link

I'm submitting a possible bug report (excuse me if that's intentional and it's a feature request)

[X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primevue/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=110

Current behavior
Currently, the Steps component does not support named routes, because of how it marks the active step:

isActive(item) {
    return this.activeRoute === item.to || this.activeRoute === item.to + '/' ;
},

https://github.com/primefaces/primevue/blob/master/src/components/steps/Steps.vue#L59

Expected behavior
I'd expect it to correctly mark routes as active even if I provide named ones:

steps = [{ label: 'Dashboard', to: { name: 'dashboard' } }];

What is the motivation / use case for changing the behavior?
Currently you need to duplicate your (possibly complex) routes in your router, as well as in your steps configuration. This is extremely painful when working with props:

{ to: `/app/campaigns/${campaignID}/edit/${sectionID}/` }
@cagataycivici
Copy link
Member

Tracked at;

#594

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants