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

TabMenu should include subpaths in active tab detection #417

Closed
Dravere opened this issue Aug 1, 2020 · 0 comments
Closed

TabMenu should include subpaths in active tab detection #417

Dravere opened this issue Aug 1, 2020 · 0 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@Dravere
Copy link

Dravere commented Aug 1, 2020

The TabMenu only checks if the current path matches with the tab menu path. I would suggest to include sub-paths in that check as well and thus use startsWith to check for an active path.

return this.activeRoute === item.to || this.activeRoute === item.to + '/' ;

isActive(item) {
    return this.activeRoute.startsWith(item.to);
},

So that for example if the menu points at /items/ and we are at /items/edit/6, I would say we are still in the items menu and it should be marked as active.

@cagataycivici cagataycivici self-assigned this Aug 4, 2020
@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Aug 4, 2020
@cagataycivici cagataycivici added this to the 2.0.6 milestone Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants