mirror of
https://github.com/sst/opencode.git
synced 2025-07-08 00:25:00 +00:00
docs: share fix scrolling again
This commit is contained in:
parent
143fd8e076
commit
994368de15
1 changed files with 3 additions and 0 deletions
|
@ -601,6 +601,7 @@ export default function Share(props: {
|
||||||
messages: Record<string, Message.Info>
|
messages: Record<string, Message.Info>
|
||||||
}) {
|
}) {
|
||||||
let lastScrollY = 0
|
let lastScrollY = 0
|
||||||
|
let hasScrolledToAnchor = false
|
||||||
let scrollTimeout: number | undefined
|
let scrollTimeout: number | undefined
|
||||||
let scrollSentinel: HTMLElement | undefined
|
let scrollSentinel: HTMLElement | undefined
|
||||||
let scrollObserver: IntersectionObserver | undefined
|
let scrollObserver: IntersectionObserver | undefined
|
||||||
|
@ -954,9 +955,11 @@ export default function Share(props: {
|
||||||
// Wait till all parts are loaded
|
// Wait till all parts are loaded
|
||||||
if (
|
if (
|
||||||
hash !== ""
|
hash !== ""
|
||||||
|
&& !hasScrolledToAnchor
|
||||||
&& msg.parts.length === partIndex() + 1
|
&& msg.parts.length === partIndex() + 1
|
||||||
&& data().messages.length === msgIndex() + 1
|
&& data().messages.length === msgIndex() + 1
|
||||||
) {
|
) {
|
||||||
|
hasScrolledToAnchor = true
|
||||||
scrollToAnchor(hash)
|
scrollToAnchor(hash)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue