feat: disable page scroll auto history state

This commit is contained in:
DIYgod
2023-05-10 23:52:28 +01:00
parent ee663250a3
commit 72ffe89881
+6 -6
View File
@@ -39,13 +39,13 @@ function useActiveId(itemIds: string[]) {
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
const state = history.state
// const state = history.state
history.replaceState(
{ ...state, preventScrollToToc: true },
"",
entry.target.getAttribute("href"),
)
// history.replaceState(
// { ...state, preventScrollToToc: true },
// "",
// entry.target.getAttribute("href"),
// )
setActiveId(entry.target.getAttribute("href"))
}
})