fix: changing the page, the period or a filter keeps the scroll position

This commit is contained in:
hh committed 2026-10-16 18:16:06 +00:00
1 parent f771538f3e
commit 4936258f32
3 files changed
+8 -4

No files matched your search

+1 -1
View File
@@ -10,5 +10,5 @@ export function setQuery(values: Record<string, string | null | undefined>) {
url.searchParams.delete(key); url.searchParams.delete(key);
} }
} }
return goto(url, { replace: true, state: page.state }); return goto(url, { replace: true, reset: false, state: page.state });
} }
+6 -2
View File
@@ -28,7 +28,7 @@
function go(target: number) { function go(target: number) {
if (target >= 1 && target <= pages && target !== page) { if (target >= 1 && target <= pages && target !== page) {
goto(href(target)); goto(href(target), { reset: false });
} }
} }
@@ -53,7 +53,11 @@
</script> </script>
{#if pages > 1} {#if pages > 1}
<nav aria-label="Pages" class="flex items-center gap-0.5 text-[12px]"> <nav
aria-label="Pages"
class="flex items-center gap-0.5 text-[12px]"
data-sveltekit-reset="false"
>
{#if page > 1} {#if page > 1}
<a <a
class="rounded-cladd-sm px-2 py-1 text-cladd-fg-soft hover:bg-row-hover hover:text-cladd-fg" class="rounded-cladd-sm px-2 py-1 text-cladd-fg-soft hover:bg-row-hover hover:text-cladd-fg"
@@ -111,7 +111,7 @@
url.pathname = listPath(type); url.pathname = listPath(type);
} }
if (url.href !== page.url.href) { if (url.href !== page.url.href) {
tick().then(() => goto(url, { replace: true })); tick().then(() => goto(url, { replace: true, reset: false }));
} }
}); });
}); });