Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ScrollView: Smart
contentOffset
preserving
Summary: Previous `contentOffset` can be invalid for a new layout and overscroll the ScrollView, so the diff fixes that. Also documented here: #13566 Reviewed By: mmmulani Differential Revision: D5414442 fbshipit-source-id: 7de1b4a4571108a37d1795e80f165bca5aba5fef
- Loading branch information
1d22f8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
1d22f8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shergin This breaks setting negative offsets, I'm using this with
contentInset
+ RefreshControl to make sure it is positioned properly under a overlapping header. This could probably be solved by supportingprogressViewOffset
on iOS, not sure if there are other use cases for negative offsets.1d22f8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janicduplessis So, do you think we have to support setting negative value for
contentOffset
? Or we should just fixRefreshControl
properly on native side? Can we do this without adding additional props?1d22f8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the only use case I have for negative contentOffset, idk if there are others. RefreshControl already has a prop called
progressViewOffset
that is Android only so we could make it work on iOS to control where it appears.1d22f8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janicduplessis PR is very welcome. 😸
1d22f8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shergin I think someone made a PR a while back but it never got merged, I could try to revive it.
1d22f8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this made it into v0.48 without a fix for the RefreshControl issue. Past PRs that @janicduplessis mentioned: #10718, #11356.
New issue: #15808