mirror of
https://github.com/sst/opencode.git
synced 2025-07-07 16:14:59 +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>
|
||||
}) {
|
||||
let lastScrollY = 0
|
||||
let hasScrolledToAnchor = false
|
||||
let scrollTimeout: number | undefined
|
||||
let scrollSentinel: HTMLElement | undefined
|
||||
let scrollObserver: IntersectionObserver | undefined
|
||||
|
@ -954,9 +955,11 @@ export default function Share(props: {
|
|||
// Wait till all parts are loaded
|
||||
if (
|
||||
hash !== ""
|
||||
&& !hasScrolledToAnchor
|
||||
&& msg.parts.length === partIndex() + 1
|
||||
&& data().messages.length === msgIndex() + 1
|
||||
) {
|
||||
hasScrolledToAnchor = true
|
||||
scrollToAnchor(hash)
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue