solid-router
solid-router copied to clipboard
`<A>` link detects incorrect active state when `href` has a trailing slash
Describe the bug
Consider this link:
<A href="/solid-router/">Click</A>
When I'm on the /solid-router/ route, this link is correctly considered active. However, when I navigate to the /solid-router/route route, the same link is not active.
I've traced this behavior to this line of code. It appears that a trailing slash is added to the href before comparison, regardless of whether the href already includes one.
If this behavior is intentional, it should be clarified in the documentation. The current documentation suggests that Solid Router simply checks whether the current location starts with the href. I'm happy to update the documentation to reflect this if confirmed.
Your Example Website or App
...
Steps to Reproduce the Bug or Issue
...
Expected behavior
...
Screenshots or Videos
No response
Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]
Additional context
No response