Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Vertical nav doesn't update .active on page change #39

Closed
tomer opened this issue Jul 29, 2018 · 5 comments
Closed

Vertical nav doesn't update .active on page change #39

tomer opened this issue Jul 29, 2018 · 5 comments

Comments

@tomer
Copy link

tomer commented Jul 29, 2018

Currently only the Ipsum item is active=true regardless the active page.

Steps to reproduce:

  • Open the demo app.
  • Navigate to a different page than Ipsum

Actual result:

Please notice that the Ipsum menu items keeps highlighted even after navigating away.

image

@priley86
Copy link
Member

priley86 commented Aug 6, 2018

i was noticing the same... will try to resolve this in #36 soon.

@Mhbuur
Copy link

Mhbuur commented Aug 24, 2018

the current activeItem search implementation ...

    const activeItem = this.menu.find(
      item => location.pathname.indexOf(item.to) > -1
    );

... will always match the first item '/' for any location.

Here is a fix for that:

    const activeItem = this.menu.find(
      item => location.pathname === item.to
    );

@priley86
Copy link
Member

thanks... apologies, I have not had much time to look at this. I pushed a small change to allow for this in #43 , as well as ensuring the "Ipsum" nav is still selected when subnavs are selected.

@priley86
Copy link
Member

I should note that, for more complex / auth based routing, we have started the rcue branch which uses a custom masthead. May also be useful for some folks.

@mturley
Copy link
Contributor

mturley commented Sep 11, 2018

This was resolved by #45.

@mturley mturley closed this as completed Sep 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants