I am building a React application, I have multiple Grid
components, combined with ScrollSync
, like this:
<ScrollSync>
...
<Grid />
<Grid />
...
</ScrollSync>
It looks something like this:
They are scrolling correctly, one is following another. BUT, I need GRID 1 to be fully rendered in DOM, always.
Grid's overscanRowCount
option isn't helping, as it only gives me n number of rows, but only in direction of scrolling.
For example if I have 10 rows rendered, and I have set overscanRowCount
to 6 - if I am scrolling down I will have 10 + bottom 6 rows, if I am scrolling to top, I will have 10 + 6 top rows.
Why do I need it? My app looks like this:
So, when for example "prod5" item goes out of the DOM, that blue line goes missing too, every line is going from row item to the top.
Good option to me would be to have n top AND bottom rows rendered, or simply - all of them. Any solutions or workarounds? I searched a lot, couldn't find anything helpful.