[Web] Fix thread jumps
This commit is contained in:
@@ -193,12 +193,11 @@ export function PostThread({uri}: {uri: string}) {
|
|||||||
* will give us a _positive_ offset, which will scroll the anchor post
|
* will give us a _positive_ offset, which will scroll the anchor post
|
||||||
* back _up_ to the top of the screen.
|
* back _up_ to the top of the screen.
|
||||||
*/
|
*/
|
||||||
list.scrollToOffset({
|
const offset = anchorOffsetTop - headerHeight
|
||||||
offset: anchorOffsetTop - headerHeight,
|
list.scrollToOffset({offset})
|
||||||
})
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* After the second pass, `deferParents` will be `false`, and we need
|
* After we manage to do a positive adjustment, we need
|
||||||
* to ensure this doesn't run again until scroll handling is requested
|
* to ensure this doesn't run again until scroll handling is requested
|
||||||
* again via `shouldHandleScroll.current === true` and a params
|
* again via `shouldHandleScroll.current === true` and a params
|
||||||
* change via `prepareForParamsUpdate`.
|
* change via `prepareForParamsUpdate`.
|
||||||
@@ -210,7 +209,7 @@ export function PostThread({uri}: {uri: string}) {
|
|||||||
* subsequent size changes unrelated to a params change (like pagination)
|
* subsequent size changes unrelated to a params change (like pagination)
|
||||||
* do not affect scroll.
|
* do not affect scroll.
|
||||||
*/
|
*/
|
||||||
if (!deferParents || isRoot) shouldHandleScroll.current = false
|
if (offset > 0 || isRoot) shouldHandleScroll.current = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user