-
Notifications
You must be signed in to change notification settings - Fork 24k
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
Animated.Loop prevents VirtualizedList updates #16092
Comments
I've got the same issue on 0.47.1. I noticed the same thing as you--removing |
VirtualizedList is probably using InteractionManager to schedule work but get's blocked by your looping animation. You can add |
Maybe we could set isInteraction to false automatically when using Animated.loop since the main use case is for long running animations and it should not block InteractionManager. |
Ah perfect! Yeah that sounds like a sensible change, but at the very least a documentation update would be really helpful. Thank you! What are your thoughts on the potential VirtualizedList |
@willdawsonme I submitted a doc update in #16136. |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 6.9.1
Yarn: 0.17.9
npm: 3.10.10
Watchman: 4.7.0
Xcode: Xcode 8.3 Build version 8E162
Android Studio: 2.2 AI-145.3537739
Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: 0.48.3 => 0.48.3
Steps to Reproduce
Expected Behavior
I would expect the new cells to render.
Actual Behavior
New cells do not render, only the cells that rendered initially are visible.
Reproducible Demo
https://snack.expo.io/H18xSNvi-
Comments
I believe part of the issue lies in
_scheduleCellsToRenderUpdate
:react-native/Libraries/Lists/VirtualizedList.js
Lines 1090 to 1099 in 3649fce
When scrolling, cell updates are scheduled and never called. Adding
useNativeDriver: true
to the child animation doesn't seem to help.Removing the
getItemLayout
handler causes the list to calculate anaverageCellLength
. Now, the cell updates aren't scheduled but rendered immediately. Perhaps if a getItemLayout handler is provided an averageCellLength could be calculated which would let hiPri updates be rendered immediately.Thanks
The text was updated successfully, but these errors were encountered: