From 7cdfb90b1b37bd0bd29366f0c359320c0c6752db Mon Sep 17 00:00:00 2001 From: gbanyan Date: Fri, 21 Nov 2025 01:48:10 +0800 Subject: [PATCH] Portal mobile TOC overlay to stay floating --- components/post-layout.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/components/post-layout.tsx b/components/post-layout.tsx index a60accc..9921ee9 100644 --- a/components/post-layout.tsx +++ b/components/post-layout.tsx @@ -19,6 +19,17 @@ export function PostLayout({ children, hasToc = true, contentKey }: { children: setMounted(true); }, []); + const mobileToc = isTocOpen && hasToc && mounted + ? createPortal( +
+
+ setIsTocOpen(false)} /> +
+
, + document.body + ) + : null; + const tocButton = hasToc && mounted ? (