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

Active Paths containing optional params don't activate related links #3233

Closed
outdooricon opened this issue Mar 30, 2016 · 2 comments
Closed

Comments

@outdooricon
Copy link

Given a route containing an optional piece (path="/test(/:case)"), when you are sitting on a route matching the optional part (url is /test/case1), then a Link for the required base url (to="/test") doesn't receive it's activeClass. This is important for me since the /test Link is in navigation and my component for handling /test as well as any /test/case is the same. I need the /test Link to stay active when when viewing any of the cases, since that is the section you're viewing.

Version

2.0.0

Test Case

http://jsbin.com/canuruhavo/edit?html,css,js,output

Steps to reproduce

  • Click on "test link"

Expected Behavior

  • The link "this test link should be active" should have active class and be red.

Actual Behavior

  • The link "this test link should be active" doesn't receive the active class
@taion
Copy link
Contributor

taion commented Mar 30, 2016

This is working as intended. All params, including optional ones, have to match. You'd have to actually set up a parent route for things to work as you describe.

We're considering changing this – see #3231.

@taion taion closed this as completed Mar 30, 2016
@taion taion added the invalid label Mar 30, 2016
@outdooricon
Copy link
Author

Ok thanks @taion! Thought I'd report it in case it was one of those missed edge cases. I'll just continue with my nested routes instead, as you suggested. 👍

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

2 participants