DEV Community

Discussion on: Create a React virtualization/windowing component from scratch

Collapse
 
santhoshkumar_a_67d86f51c profile image
Santhoshkumar A

This looks great!!

I want to handle the UI two dimension like horizontally and vertically. For this case we can't measure width for each item.

Example input
[{
id:1,
name: "BCA",
subjects: ["maths","english","physics"]
},
{
id:2,
name: "BSC",
subjects: ["Hindi","english","science"]
}]

The name should be aligned vertically. subjects should be aligned horizontally. if it overflows need to wrap it.
How to handle this case?

Collapse
 
mr_mornin_star profile image
Akashdeep Patra

Not clear about your exact question, any reproduction/ details would be helpful in understanding the problem.

Collapse
 
santhoshkumar_a_67d86f51c profile image
Santhoshkumar A

I have given this scenario i don't know height and width. so for the virtualization height and width is crucial right?
Thanks for your reply.

This kind of dynamic UI how to handle with virtualization?
Image description

Thread Thread
 
mr_mornin_star profile image
Akashdeep Patra

Sorry for the delayed response, but yes , the assumption for virtualized grid would also work similarly, you'll need to calculate the horizontal displacement to deduce the next items as well , but I think this problem has already been solved by other libraries, so maybe using something like that would be better for production.