This fixes an edge case with the target content offset anchor calculation. If the content is shorter than the visible bounds, that means we're simultaneously at our topmost offset and bottommost offset. In this scenario, the previous logic would always calculate a target content offset anchor of .top. The correct logic in this scenario should be:
Anchor is .top if our verticalLayoutDirection is .topToBottom
Anchor is .bottom if our verticalLayoutDirection is .bottomToTop
Related Issue
Noticed a scenario where new messages don't push the content down when a thread is just getting started (short content height)
Details
This fixes an edge case with the target content offset anchor calculation. If the content is shorter than the visible bounds, that means we're simultaneously at our topmost offset and bottommost offset. In this scenario, the previous logic would always calculate a target content offset anchor of
.top
. The correct logic in this scenario should be:.top
if ourverticalLayoutDirection
is.topToBottom
.bottom
if ourverticalLayoutDirection
is.bottomToTop
Related Issue
Noticed a scenario where new messages don't push the content down when a thread is just getting started (short content height)
Motivation and Context
Squashin bugs
How Has This Been Tested
Example app
Types of changes
Checklist