T
TanStack3y ago
quickest-silver

Is there a way to auto size the scroll area to parent?

Similar to how you might use react-window and AutoSizer to create a virtualized list that fits inside it's parent element, is there a way within Virtual's existing framework to do the same? As an example, say I have a flex box layout and the height of the container element is set to 100vh. Ideally I would like Virtual to always take up all the vertical space it has and render rows accordingly.
3 Replies
quickest-silver
quickest-silverOP3y ago
Yup. Figured that would be the case. My only issue with Autosizer is it's relative lack of active development and whether it's going to remain future proof. I would also point out that other libs doing similar things (react-virtuoso for example) do handle this out of the box so it would be great to eventually see it in Virtual
xenial-black
xenial-black3y ago
like in this example https://codesandbox.io/p/sandbox/frosty-morse-scvryz sorry for the confusion
frosty-morse-scvryz
CodeSandbox is an online editor tailored for web applications.
xenial-black
xenial-black3y ago
Basic create a div to take remaining space, use it as scroll element

Did you find this page helpful?