fix: don't autoscroll to current item in TOC when TTS is on (#311)

This commit is contained in:
Huang Xin
2025-02-07 19:08:50 +01:00
committed by GitHub
parent dee1e28a61
commit c79657a1ee
@@ -120,7 +120,7 @@ const TOCView: React.FC<{
};
useEffect(() => {
if (!progress) return;
if (!progress || eventDispatcher.dispatchSync('tts-is-speaking')) return;
const { sectionHref: currentHref } = progress;
const hrefMd5 = currentHref ? getContentMd5(currentHref) : '';
const currentItem = viewRef.current?.querySelector(`[data-href="${hrefMd5}"]`);