defaultValue not applyed in a second client side navigation
Closed this issue · 3 comments
jycouet commented
Describe the bug
I have this setting:
const store_qp = queryParameters({
withOne: ssp.boolean(true),
withTwo: ssp.boolean(false),
pushHistory: false,
})
First time I see the page, I see my queryParams getting updated, it's all good.
Then, I navigate (client side), and when at some point I go back to this page, defaults don't get applied.
When, I leave the page, my +page.svelte get destoyed well. So I'm not sure what's happening.
Thanks for your help
Reproduction
https://www.sveltelab.dev/?provider=github&owner=jycouet&repo=veltekit-search-params-default-value
- Navigate to Page A
✅ query param are displayed and applied - Navigate to Page B
✅ Nothing special, it's going there - Navigate to Page A
❌ Default query params are not applied.
Logs
No response
jycouet commented
Any insights @paoloricciuti ?
paoloricciuti commented
Any insights @paoloricciuti ?
Yeah I plan to look into this in the near future
paoloricciuti commented
The PR should fix it however i noticed something interesting: if you never use the store it never trigger the redirect (i guess it's because it never subscribe to the store)