docs: share fix scroll to anchor
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
Jay V 2025-07-03 20:30:17 -04:00
parent 37327259cb
commit 167a9dcaf3

View file

@ -957,7 +957,12 @@ export default function Share(props: {
onMount(() => { onMount(() => {
const hash = window.location.hash.slice(1) 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) scrollToAnchor(hash)
} }
}) })