Fix sticky bottom anchoring on initial content growth

This commit is contained in:
Mohamed Boudra
2026-06-09 10:46:24 +07:00
parent 9ce6a38792
commit 6c3e2bd703
2 changed files with 55 additions and 5 deletions
@@ -560,6 +560,12 @@ function createBottomAnchorControllerDriver(
});
if (shouldRestick && !pendingRequest) {
pendingVerification = { requestId: null, retries: 0 };
if (attemptHandle) {
input.cancelFrame(attemptHandle);
attemptHandle = null;
}
runAttempt(false);
return;
}
if (shouldRestick || pendingRequest) {
evaluate(false, "content_size_change");
@@ -656,11 +662,7 @@ export const __private__ = {
previousContentHeight: number;
contentHeight: number;
}): boolean {
return (
input.mode === "sticky-bottom" &&
input.previousContentHeight > 0 &&
input.contentHeight > input.previousContentHeight
);
return input.mode === "sticky-bottom" && input.contentHeight > input.previousContentHeight;
},
shouldDetachFromScrollAway(input: {
mode: BottomAnchorMode;