Allow partially visible items to be picked as scroll anchors for maintainVisibleContentPosition#43203
Closed
RandomEngy wants to merge 1 commit into
Closed
Allow partially visible items to be picked as scroll anchors for maintainVisibleContentPosition#43203RandomEngy wants to merge 1 commit into
RandomEngy wants to merge 1 commit into
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D54223244 |
Base commit: 15f0895 |
d3962a4 to
ccb08b7
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D54223244 |
…tainVisibleContentPosition Summary: The current behavior for `maintainVisibleContentPosition` on ScrollView is to pick the first fully visible item as the scroll anchor. This has a number of disadvantages: * It causes problems for lists with loading indicators and large items. The loading glimmer can be picked as the anchor and pull the scroll down too quickly. This is the case for Marketplace. * It's inconsistent with the [CSS Scroll Anchoring](https://www.w3.org/TR/css-scroll-anchoring-1/) behavior, which is to pick the first partially visible view. This change will switch to picking the first partially visible view as the anchor, to align with the CSS implementation. Discussed the change with yungsters, NickGerleman, and cipolleschi and agreed about the change in behavior. This also enables `maintainVisibleContentPosition` for Android. After adding it to `validAttributes` for Android it appears to be working well. Previously it was not functional at all on Android, as the property change from React was not passed to ReactScrollViewManager.java. ## Changelog: [General] [Changed] - maintainVisibleContentPosition property on ScrollView now selects the first partially visible view as the anchor, rather than the first fully visible view. Reviewed By: NickGerleman Differential Revision: D54223244
ccb08b7 to
875bdc3
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D54223244 |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
The current behavior for
maintainVisibleContentPositionon ScrollView is to pick the first fully visible item as the scroll anchor. This has a number of disadvantages:This change will switch to picking the first partially visible view as the anchor, to align with the CSS implementation.
Discussed the change with yungsters, NickGerleman, and cipolleschi and agreed about the change in behavior.
This also enables
maintainVisibleContentPositionfor Android. After adding it tovalidAttributesfor Android it appears to be working well. Previously it was not functional at all on Android, as the property change from React was not passed to ReactScrollViewManager.java.Changelog:
[General] [Changed] - maintainVisibleContentPosition property on ScrollView now selects the first partially visible view as the anchor, rather than the first fully visible view.
Differential Revision: D54223244