sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7k stars 434 forks source link

Fix scroll position is not restored after changing search param with `goto` #1697

Closed istarkov closed 3 years ago

istarkov commented 3 years ago

fixes #1321

goto must have same order of execution as handle_click

istarkov commented 3 years ago

tests are added from the corresponded issue

istarkov commented 3 years ago

timeout on ci test, not somehow related to this PR

benmccann commented 3 years ago

If we update this we'll also need to take a look at updating SvelteKit which shares this code: https://github.com/sveltejs/kit/blob/6668f2d9e9edae2430a5616679883f68c165fd62/packages/kit/src/runtime/internal/router/index.js#L168

It's possible that SvelteKit isn't affected by this bug though since it's scroll tracking was rewritten

benmccann commented 3 years ago

I was not able to reproduce this in SvelteKit, so no changes should be necessary there