For the bottomToTop layout, the y offset adjustment max(currentCollectionView.bounds.height - newBounds.height + contentInset.bottom, 0) is not right. we should not involve the contentInset.bottom.
The iOS system will help adjust the yOffset when new bounds exceed the boundary. It means we should check
if newBounds.maxY < currentCollectionView.contentSize.height + contentInset.bottom as well.
Motivation and Context
We are building an messaging screen for Airbnb and I find this issue causes the message cells jumping when typing indicator hide and show.
How Has This Been Tested
I built a small sample to test this case.
Before this change: The cells move up every time the bounds changed.
After the change: The cells keep bottom spacing the same.
Details
For the bottomToTop layout, the y offset adjustment
max(currentCollectionView.bounds.height - newBounds.height + contentInset.bottom, 0)
is not right. we should not involve thecontentInset.bottom
. The iOS system will help adjust the yOffset when new bounds exceed the boundary. It means we should checkif newBounds.maxY < currentCollectionView.contentSize.height + contentInset.bottom
as well.Motivation and Context
We are building an messaging screen for Airbnb and I find this issue causes the message cells jumping when typing indicator hide and show.
How Has This Been Tested
I built a small sample to test this case. Before this change: The cells move up every time the bounds changed. After the change: The cells keep bottom spacing the same.
Types of changes
Checklist