AlexxNB / tinro

Highly declarative, tiny, dependency free router for Svelte's web applications.
MIT License
669 stars 30 forks source link

Use:active isn't working with query params #85

Closed jamauro closed 2 years ago

jamauro commented 2 years ago

Thanks for the router. It's been great.

I'm trying to leverage use:active. When I have query params e.g. /something?q=test, the active class isn't being applied.

Here's a quick example: https://svelte.dev/repl/c1ffe8a68ce941ab93c1ab60e5b329f9?version=3.42.1

I would expect Contacts in the main nav to be bolded. Am I missing something?

Prinzhorn commented 2 years ago

Bug is here

https://github.com/AlexxNB/tinro/blob/b4d3c0c8632d90b510f42f08124ee3f56d6dd609/src/router.js#L37

This needs to use node.pathname and not access the full attribute.

AlexxNB commented 2 years ago

Thanks, I will fix it

AlexxNB commented 2 years ago

closed in ddb222868da9a26376319c835763eab2deb6aa45