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

Sometimes it renders blank rows #74

Closed
revh opened this issue Jan 24, 2018 · 12 comments
Closed

Sometimes it renders blank rows #74

revh opened this issue Jan 24, 2018 · 12 comments

Comments

@revh
Copy link

revh commented Jan 24, 2018

Hi,

i'm trying to use this library because i have a large list so.. at first glance i was perfect and really fast, but when i scroll at the bottom of the list i see some blank rows.

this is my code:

<LargeList
  style={{ flex: 1 }}
  numberOfRowsInSection={section => this.sectionsInSections[section].info.length}
  numberOfSections={() => Object.keys(this.sectionsInSections).length}
  heightForCell={() => this.ITEM_HEIGHT}
  heightForSection={() => this.ITEM_HEIGHT}
  renderCell={this.renderItem2}
  renderSection={this.renderSectionHeader2}
  renderItemSeparator={() => <ListSeparator />}
/>

renderItem2 and renderSectionHeader2 only returns a and this.ITEM_HEIGHT is 40.

Don't know if this is important but LargeList is wrapped inside this component https://github.com/skv-headless/react-native-scrollable-tab-view

Thank you

@bolan9999
Copy link
Owner

Let me see your screen snapshot, plz

@bolan9999
Copy link
Owner

Is is the same with issue #66 ?

@bolan9999
Copy link
Owner

You can set numberOfSectionPoolSize or numberOfCellPoolSize to solve your problem

@revh
Copy link
Author

revh commented Jan 24, 2018

Thank you, as you can see in the screenshoot within 2 scroll a section appear and disappear,

schermata 2018-01-24 alle 11 00 17

schermata 2018-01-24 alle 10 59 50

It seems that setting numberOfSectionPoolSize to the number of my section do the job on the simulator but on an iPhoneX scrolling too fast down and up it leads to weird things like the most top section doesn't have rows, multiple rows with the same text and app crash :(

i tried also with numberOfSectionPoolSize to the number of rows in total

Thanks

@bolan9999
Copy link
Owner

try to set numberOfSectionPoolSize to 15

@revh
Copy link
Author

revh commented Jan 24, 2018

Ok is better, but scrolling down and up the app crash with this error:

undefined is not an object (evaluating 'e.sectionsInSections[t].info')

it seems that numberOfRowsInSection or renderItem/renderSection are passing a not valid section index?

thank you

@bolan9999
Copy link
Owner

Do you change your data source ? If you did, you must call reloadData. see the docs,plz

@revh
Copy link
Author

revh commented Jan 24, 2018

the data source is not changed, if i add this code, to debug the problem, it yields -1 some times

numberOfRowsInSection={section =>
                        this.sectionsInSections[section]
                            ? this.sectionsInSections[section].info.length
                            : alert(section)
                    }

@bolan9999
Copy link
Owner

Maybe it is a bug.

I'll fix it right row. You can return 0 if section === -1 for this version.

@revh
Copy link
Author

revh commented Jan 24, 2018

Thank you @bolan9999 !

i want also to report that if you scroll programmatically using

this.list.scrollToIndexPath(this.list.bottomIndexPath, false)

and then

this.list.scrollToIndex(this.list.topIndexPath, false)
(i want to implement an alphabetic index on the side)

it leads to some not updated sections or blank rows

@bolan9999
Copy link
Owner

I have tried, and there is no problem on scrollToIndexPath. How do you operate? More information need! Scrolling must action after LargeList finish initializing.

@bolan9999
Copy link
Owner

No response for 4 days,closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants