tbranyen / hyperlist

A performant virtual scrolling list utility capable of rendering millions of rows
Other
448 stars 45 forks source link

Delayed rendering when scrolling upwards #36

Closed fabien closed 7 years ago

fabien commented 7 years ago

When scrolling back upwards, I was sometimes missing the topmost item, probably due to this:

https://github.com/tbranyen/hyperlist/blob/master/dist/hyperlist.js#L108

I decided to replace this with the following:


var difference = lastRepaint ? scrollTop - lastRepaint : 0; // FIX
if (!lastRepaint || difference < 0 || difference > _this._averageHeight) { ... }

This seems to behave much better. Does this make any sense? Thanks for HyperList!

soyuka commented 7 years ago

Makes sense. Would you mind issuing a pull request with that patch?

fabien commented 7 years ago

I currently don't have the project setup on my machine to run tests and so on.

Would you mind handling it instead?