schrodinger/fixed-data-table-2

Why endRowIndex and firstRowIndex are not passed to onVerticalScroll and onHorizontalScroll?

Opened this issue · 2 comments

Imagine someone is building a table, which supports infinite scroll and the amount of total rows is not known (hence the Infinite scroll example in examples folder would not work as it requires to know total amount of rows in advance). Currently, it would be possible to do that with onScrollEnd. However, the function only gets called after user stop scrolling and as result we can't fetch data in advance (lets assume we want to fetch additional data once user scrolls past 50% of visible rows).

There properties are already passed to "onScrollEnd". Shouldn't they also be passed to onVerticalScroll and onHorizontalScroll? Such change shouldn't break anything.

Yea, passing the the first and last visible row index to onHorizontalScroll seems reasonable.

We'd be happy to accept a PR for this, or I'll try and put up a PR myself in the next few days.

I'll make PR for this tomorrow in case it won't exist by then:)