-
Notifications
You must be signed in to change notification settings - Fork 816
Why items are absolutely positioned? #133
Copy link
Copy link
Closed
Description
Hi,
Thank you for rewriting react-virtualized, react-window is far cleaner!
I have one question. In both react-virtualized and react-window cells are absolutely positioned. Why?
I have made react-virtualized work with statically positioned items, by inserting a "spacer" div before rows via cellRangeRenderer. That spacer div has margin-top set to the style.top of first rendered row.
When rows are positioned statically
- There is no need to update
topon each row element during scrolling, which makes React update faster. - Overlap issues are completely impossible, because rows naturally flow one after another. By saying overlap issues I mean issues when some row dynamically changes its height but Grid consumer don't call
recomputeBodyGridSizeto make Grid recalculate top offsets for each row so as a result upper row renders overlapping next row. - There is no need in storing top offsets for each row and maintaining style cache.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels