Calculate # of items that fit in the viewport #912
-
Hello! I'm rendering a table with a fixed height (eg: 500px) and sometimes I have fewer rows than what's needed to fill the entire table. I'd like to pad the data with just enough empty rows such that the entire table body height is filled. What's a good way to compute the number of pad rows? Also - is there a way to adjust the table height so that it neatly aligns with the a row boundary? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There's a relatively low-level callback - A cool enhancement for both the list and the table would be a minHeight / maxHeight (or, maybe, even, |
Beta Was this translation helpful? Give feedback.
There's a relatively low-level callback -
totalListHeightChanged
that you can use to do that. Here's a crude example.A cool enhancement for both the list and the table would be a minHeight / maxHeight (or, maybe, even,
minItemsDisplayed
/maxItemsDisplayed
) props that would make such scenarios trivial for the developer.