diff --git a/src/app/content/components/Page/scrollToTopOrHashManager.ts b/src/app/content/components/Page/scrollToTopOrHashManager.ts index 4f0a2f12a6..66c23732d6 100644 --- a/src/app/content/components/Page/scrollToTopOrHashManager.ts +++ b/src/app/content/components/Page/scrollToTopOrHashManager.ts @@ -30,18 +30,10 @@ const scrollToTargetOrTop = (container: HTMLElement | null, hash: string, previo if (getScrollTarget(container, hash)) { scrollToTarget(container, hash); } else if (previous) { - scrollToTop(); + assertWindow().scrollTo(0, 0); } }; -const scrollToTop = () => { - const window = assertWindow(); - const document = window.document; - - document.querySelector('main')?.focus(); - window.scrollTo(0, 0); -}; - const getScrollTarget = (container: HTMLElement | null, hash: string): HTMLElement | null => { return container && typeof(window) !== 'undefined' && hash ? container.querySelector(`[id="${hash.replace(/^#/, '')}"]`)