From fc16d3100a57335d6668d4d7dcdce6a3143bb7a4 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 13 Apr 2026 18:04:27 -0400 Subject: [PATCH] fix: Auto-hide TOC when window shrinks below mobile breakpoint (#12014) --- app/scenes/Document/components/Header.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/scenes/Document/components/Header.tsx b/app/scenes/Document/components/Header.tsx index b354e5f17b..6430966d9b 100644 --- a/app/scenes/Document/components/Header.tsx +++ b/app/scenes/Document/components/Header.tsx @@ -125,6 +125,12 @@ function DocumentHeader({ const showContents = ui.tocVisible === true || (isShare && ui.tocVisible !== false); + useEffect(() => { + if (isMobile && showContents) { + ui.set({ tocVisible: false }); + } + }, [isMobile, showContents, ui]); + const toc = (