Input
items = ["A", "B", "C", "D", "E", "F"], rowHeight=20, viewportHeight=60, overscan=1 User scrolls to scrollTop=40
Output
Rendered rows: ["B", "C", "D", "E", "F"]
Top visible index is 2; with overscan=1, rendered range is indices 1 through 5.
Given `items`, `rowHeight`, `viewportHeight`, and `overscan`, build a virtualized scrolling list. Render a scroll container with `data-testid="virtual-list"` at exactly `viewportHeight` pixels tall. Only render the curr...
index.htmlEditable templatestyles.cssEditable startermain.jsEditable starteritems = ["A", "B", "C", "D", "E", "F"], rowHeight=20, viewportHeight=60, overscan=1 User scrolls to scrollTop=40
Rendered rows: ["B", "C", "D", "E", "F"]
Top visible index is 2; with overscan=1, rendered range is indices 1 through 5.
Can you avoid re-creating DOM nodes on every scroll by reusing a fixed pool of row elements?