pull/4511/head
Divyansh Singh 8 months ago
parent 8d8f4518a8
commit 93abc90b61

@ -97,14 +97,8 @@ export function createRouter(
}) })
) )
if (hash) { if (hash) scrollTo(hash, cause?.classList.contains('header-anchor'))
scrollTo( else window.scrollTo(0, 0)
hash,
cause ? cause.classList.contains('header-anchor') : false
)
} else {
window.scrollTo(0, 0)
}
} }
return return
@ -156,11 +150,8 @@ export function createRouter(
history.replaceState({}, '', href) history.replaceState({}, '', href)
} }
if (targetLoc.hash && !scrollPosition) { if (targetLoc.hash && !scrollPosition) scrollTo(targetLoc.hash)
scrollTo(targetLoc.hash) else window.scrollTo(0, scrollPosition)
} else {
window.scrollTo(0, scrollPosition)
}
}) })
} }
} }

Loading…
Cancel
Save