Skip to content

Commit

Permalink
Reset value
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Sep 17, 2022
1 parent 129537a commit 792dc1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/next/client/components/layout-router.client.tsx
Expand Up @@ -165,9 +165,10 @@ export function InnerLayoutRouter({
// Only scroll into viewport when the layout is not visible currently.
if (!topOfElementInViewport(focusAndScrollElementRef.current)) {
const htmlElement = document.documentElement
const existing = htmlElement.style.scrollBehavior
htmlElement.style.scrollBehavior = 'auto'
focusAndScrollElementRef.current.scrollIntoView()
htmlElement.style.scrollBehavior = ''
htmlElement.style.scrollBehavior = existing
}
}
}, [focusAndScrollRef])
Expand Down

0 comments on commit 792dc1d

Please sign in to comment.