mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #247 from omnivore-app/fix/app-scrolling
In /app use the window to scroll to initial read position
This commit is contained in:
commit
3d5a61285c
1 changed files with 5 additions and 1 deletions
|
|
@ -151,7 +151,11 @@ export function Article(props: ArticleProps): JSX.Element {
|
|||
return 0
|
||||
}
|
||||
|
||||
props.scrollElementRef.current?.scroll(0, calculateOffset(anchorElement))
|
||||
if (props.scrollElementRef.current) {
|
||||
props.scrollElementRef.current?.scroll(0, calculateOffset(anchorElement))
|
||||
} else {
|
||||
window.document.documentElement.scroll(0, calculateOffset(anchorElement))
|
||||
}
|
||||
}
|
||||
}, [
|
||||
props.initialAnchorIndex,
|
||||
|
|
|
|||
Loading…
Reference in a new issue