We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c06a84e commit c287613Copy full SHA for c287613
1 file changed
packages/fresh/src/runtime/client/partials.ts
@@ -25,6 +25,7 @@ import { parse } from "../../jsonify/parse.ts";
25
import { INTERNAL_PREFIX, PARTIAL_SEARCH_PARAM } from "../../constants.ts";
26
27
export const PARTIAL_ATTR = "f-partial";
28
+export const PARTIAL_NO_SCROLL_ATTR = "f-dont-scroll";
29
30
class NoPartialsError extends Error {}
31
@@ -170,7 +171,9 @@ document.addEventListener("click", async (e) => {
170
171
await fetchPartials(nextUrl, partialUrl, true);
172
updateLinks(nextUrl);
173
});
- scrollTo({ left: 0, top: 0, behavior: "instant" });
174
+ if (!el.hasAttribute(PARTIAL_NO_SCROLL_ATTR)) {
175
+ scrollTo({ left: 0, top: 0, behavior: "instant" });
176
+ }
177
} finally {
178
if (indicator !== undefined) {
179
indicator.value = false;
0 commit comments