-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FlatList] The maintainVisibleContentPosition
doesn't work for the 1st time change.
#19621
Comments
It looks like your issue may be missing some necessary information. Can you run |
@react-native-bot I updated Environment section. Thanks. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Summary: Builds off of cae7179 - Make the prop a dictionary for more configuration options - Rename `maintainPositionAtOrBeyondIndex` -> `maintainVisibleContentPosition` + `minIndexForVisible` - Add autoscroll threshold feature Given the async native of RN JS and background layout, there is no way to trigger the scrollTo from JS without risking a delay, so we add the feature in native code. == Test Plan == ScrollViewExample: https://youtu.be/pmY8pxC9PRs Reviewed By: shergin Differential Revision: D6729160 fbshipit-source-id: 70f9bae460ce84567857a4f696da78ce9b3b834c
Sorry no one got to this, and thanks so much for writing up such a detailed and complete repro / test case! We'll try to take a look at this soon. |
react-native info
in your terminal and paste its contents under "Environment"share an app that reproduces the issue using https://snack.expo.io/
Environment
Environment:
OS: macOS High Sierra 10.13.4
Node: 6.11.3
Yarn: 0.24.5
npm: 5.5.1
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.1 AI-173.4670197
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.2 => 0.55.2
Description
I have a FlatList with 8 items: 100 ~ 107 are being shown
I set
minIndexForVisible = 0
formaintainVisibleContentPosition
:I have a button to prepend 90 ~ 99 (10 items in total) to the FlatList.
At beginning, the top item 100 is being shown at top of the FlatList, then I scroll down a bit, then 102 is being at top of the screen.
By clicking the prepend button, I expect the FlatList:
Then I click the prepend button again, this time, I expect the FlatList:
Steps to Reproduce
See my code on snack. https://snack.expo.io/@rainliu123/flatlisttest
Expected Behavior
The first time I prepend items to FlatList, the content position should be locked
Actual Behavior
The first time I prepend items to FlatList, the content position cannot be locked.
BTW, the subsequent prepend items to FlatList is able to keep the position.
The text was updated successfully, but these errors were encountered: