Skip to content
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

WindowedListView lags on scroll up on Android #11950

Closed
sibelius opened this issue Jan 17, 2017 · 6 comments
Closed

WindowedListView lags on scroll up on Android #11950

sibelius opened this issue Jan 17, 2017 · 6 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@sibelius
Copy link

Description

I've implemented a List of Items using WindowedListView

<WindowedListView
          data={values}
          renderRow={this.renderCell}
          initialNumToRender={10}
          onEndReached={this.handleOnEndReached}
          maxNumToRender={30}
          numToRenderAhead={20}
          viewablePercentThreshold={50}
          renderWindowBoundaryIndicator={this.renderWindowBoundaryIndicator}
          />

it works fine on iOS, but it lags a lot on Android.

this is a video of the bug: https://youtu.be/aFDBJU93b-o

it takes a lot of time to rerender the row when we scroll up, and it waits one row to be rendered after another.

this do not happen on ios

Additional Information

  • React Native version: 0.39.2
  • Platform: Android
  • Operating System: MacOS
@sibelius
Copy link
Author

I figure it out that WindowedListView uses contentInset prop of ScrollView here:

const contentInset = {top: firstRow === 0 ? 0 : -spacerHeight};

that only works on iOS

I've tried to replace it to use contentContainerStyle as described here #2914 (comment) by @satya164,

but it did not work

any ideas of how can I fix this for android?

@satya164
Copy link
Contributor

@sibelius it works for that use case, but it's not quite the same.

@bharath-kamath
Copy link

@sibelius Did you manage to fix the scroll issue?

@sibelius
Copy link
Author

No, I've migrated to FlatList

But it also has the same problem with the list has a bunch of rows

@bharath-kamath
Copy link

@sibelius Please reopen this issue as its still not fixed.

@sibelius
Copy link
Author

@bharath-kamath I recommend to move to FlatList instead of using WindowedListView,

and open another issue if you have the same problem with FlatList

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants