diff --git a/packages/core/src/eventHandler.ts b/packages/core/src/eventHandler.ts index a60467383..0c8972723 100644 --- a/packages/core/src/eventHandler.ts +++ b/packages/core/src/eventHandler.ts @@ -72,7 +72,7 @@ class EventHandler { url.hash = window.location.hash history.replaceState({ ...currentPage.get(), url: url.href }) - Scroll.reset(currentPage.get()) + Scroll.reset() return } diff --git a/packages/core/src/page.ts b/packages/core/src/page.ts index c87c17fea..f87e01911 100644 --- a/packages/core/src/page.ts +++ b/packages/core/src/page.ts @@ -80,7 +80,7 @@ class CurrentPage { return this.swap({ component, page, preserveState }).then(() => { if (!preserveScroll) { - Scroll.reset(page) + Scroll.reset() } eventHandler.fireInternalEvent('loadDeferredProps') diff --git a/packages/core/src/router.ts b/packages/core/src/router.ts index 991a32820..00ccd7bfc 100644 --- a/packages/core/src/router.ts +++ b/packages/core/src/router.ts @@ -151,7 +151,7 @@ export class Router { if (!currentPage.isCleared() && !visit.preserveUrl) { // Save scroll regions for the current page - Scroll.save(currentPage.get()) + Scroll.save() } const requestParams: PendingVisit & VisitCallbacks = { diff --git a/packages/core/src/scroll.ts b/packages/core/src/scroll.ts index b810fe000..df1bb51be 100644 --- a/packages/core/src/scroll.ts +++ b/packages/core/src/scroll.ts @@ -1,5 +1,5 @@ import { history } from './history' -import { Page, ScrollRegion } from './types' +import { ScrollRegion } from './types' export class Scroll { public static save(): void { @@ -15,7 +15,7 @@ export class Scroll { return document.querySelectorAll('[scroll-region]') } - public static reset(page: Page): void { + public static reset(): void { if (typeof window !== 'undefined') { window.scrollTo(0, 0) }