From 72ffe89881b6e5d650511b5f65cfcbc5a8dad7fe Mon Sep 17 00:00:00 2001 From: DIYgod Date: Wed, 10 May 2023 23:52:28 +0100 Subject: [PATCH] feat: disable page scroll auto history state --- src/components/site/PostToc.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/site/PostToc.tsx b/src/components/site/PostToc.tsx index 20e32cef..1b625b88 100644 --- a/src/components/site/PostToc.tsx +++ b/src/components/site/PostToc.tsx @@ -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")) } })