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

Named route records with multiple optional params result in empty URL when param is unused and path does not have trailing slash #1475

Closed
gryphonmyers opened this issue Jul 19, 2022 · 1 comment
Labels
bug Something isn't working has workaround A workaround has been found to deal with the issue

Comments

@gryphonmyers
Copy link

Version

4.1.2

Reproduction link

jsfiddle.net/98gw1b3p/

Steps to reproduce

  1. Create a named route with a path containing two optional params one after the other, with a trailing slash
  2. Create a router link that links to this route by name using a route object and no params
  3. Observe that the router link href links to "/"
  4. Create a named route with a path containing two optional params one after the other, with no trailing slash
  5. Create a router link that links to this route by name using a route object and no params
  6. Observe that the router link has no href

What is expected?

When no params are supplied to a named route with two or more optional params, the rendered router-link should have an href attribute of "/" regardless of whether a trailing slash is used or not.

What is actually happening?

When no params are supplied to a named route with two or more optional params, the rendered router-link has an href of "/" if the route path has a trailing slash, but has no href if no trailing slash is used.

@gryphonmyers
Copy link
Author

Related to #1357

@posva posva added bug Something isn't working has workaround A workaround has been found to deal with the issue labels Jul 19, 2022
@posva posva closed this as completed in 4d5182a Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has workaround A workaround has been found to deal with the issue
Projects
None yet
Development

No branches or pull requests

2 participants