diff --git a/src/screens/PostThread/index.tsx b/src/screens/PostThread/index.tsx index 64298a7789..1e646e1bbd 100644 --- a/src/screens/PostThread/index.tsx +++ b/src/screens/PostThread/index.tsx @@ -148,7 +148,9 @@ export function PostThread({uri}: {uri: string}) { */ const shouldHandleScroll = useRef(true) /** - * Called any time the content size of the list changes, _just_ before paint. + * Called any time the content size of the list changes. Could be a fresh + * render, items being added to the list, or any resize that changes the + * scrollable size of the content. * * We want this to fire every time we change params (which will reset * `deferParents` via `onLayout` on the anchor post, due to the key change), @@ -197,17 +199,17 @@ export function PostThread({uri}: {uri: string}) { list.scrollToOffset({offset}) /* - * After we manage to do a positive adjustment, we need - * to ensure this doesn't run again until scroll handling is requested - * again via `shouldHandleScroll.current === true` and a params - * change via `prepareForParamsUpdate`. + * After we manage to do a positive adjustment, we need to ensure this + * doesn't run again until scroll handling is requested again via + * `shouldHandleScroll.current === true` and a params change via + * `prepareForParamsUpdate`. * * The `isRoot` here is needed because if we're looking at the anchor * post, this handler will not fire after `deferParents` is set to * `false`, since there are no parents to render above it. In this case, - * we want to make sure `shouldHandleScroll` is set to `false` so that - * subsequent size changes unrelated to a params change (like pagination) - * do not affect scroll. + * we want to make sure `shouldHandleScroll` is set to `false` right away + * so that subsequent size changes unrelated to a params change (like + * pagination) do not affect scroll. */ if (offset > 0 || isRoot) shouldHandleScroll.current = false }