From 167a9dcaf312c2ceda2ed43e0adecf33d5e98c60 Mon Sep 17 00:00:00 2001 From: Jay V Date: Thu, 3 Jul 2025 20:30:17 -0400 Subject: [PATCH] docs: share fix scroll to anchor --- packages/web/src/components/Share.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/web/src/components/Share.tsx b/packages/web/src/components/Share.tsx index e1981100..ff838dab 100644 --- a/packages/web/src/components/Share.tsx +++ b/packages/web/src/components/Share.tsx @@ -957,7 +957,12 @@ export default function Share(props: { onMount(() => { const hash = window.location.hash.slice(1) - if (hash !== "" && hash === anchor()) { + // Wait till all parts are loaded + if ( + hash !== "" + && msg.parts.length === partIndex() + 1 + && data().messages.length === msgIndex() + 1 + ) { scrollToAnchor(hash) } })