emberjs / list-view

An incremental rendering list view for Ember.js
MIT License
465 stars 116 forks source link

cached _childViews.length used to set contentIndexEnd #250

Closed drewcovi closed 7 years ago

drewcovi commented 9 years ago

it seems that in _reuseChildren, _childViews is referenced to establish the amount of children rendered in the viewport. Since the addition of individual rowHeight per item, this can change drastically since the first couple rows might have a row height far larger then the remainder. For instance: the first element in your dataset might have a height almost the entire height of the viewport, and the remaining 100 might have ones 20px high.

In this case, the last items will never get rendered because only a few elements will be rendered into the viewport as it gets scrolled.

From what I can see the better approach would be to set a variable viewsNeededForViewport using _numChildViewsForViewport and if that is not equal to childViews, _syncChildViews() before updating the content. This all happens in _reuseChildren

https://gist.github.com/drewcovi/b79641089eaa52f5d1af

rwjblue commented 7 years ago

I'm sorry we didn't get back to this previously, but at this point this repo is essentially unmaintained. Please use @html-next/vertical-collection or ember-collection for similar functionality.

Closing...