DEV Community

Discussion on: Build your own virtual scroll - Part II

 
adamklein profile image
adam klein

Why should the width affect the calculations? I'm not following

Thread Thread
 
slidenerd profile image
slidenerd

you record heights of 50 rows, you change the width to compress the rows, depending on contents, some of the rows increase in their height, your stored heights are now invalid

Thread Thread
 
adamklein profile image
adam klein

I think this kind of situation is problematic for a virtual scroll of this sort, since the heights are returned per row, and usually not calculated based on measuring DOM nodes' dimensions.
So I would limit the "shrink factor" of the tree view and prevent the rows from wrapping and increasing in height.