5 ms·
With infinite scrolling, you can also just set the container to be absolutely huge, and use the scroll position to index. This works especially well for compute
by microcolonel 6y ago
With infinite scrolling, you can also just set the container to be absolutely huge, and use the scroll position to index. This works especially well for computed layouts like tables, where culling rows and columns is a simple scan over run lengths of row and column sizes.
Likewise if you know things will be inserted at the top of a scroll view, you can pre-allocate above the “top”.
The one thing that is hard to do well (but less hard now with new CSS features I think) is scrolling that feels good but always ends with the border of a cell being aligned to an edge of the scroll view (the Excel behaviour).
- chrismorgan 6y agoCSS Scroll Snapping may have a place for image gallery sorts of widgets, but for broader layout matters I strongly recommend against it: it can work tolerably on mobile (though it’s not without problems), but on desktop it seriously messes with scrolling so that on many devices it’s almost entirely problems. (That’s what I said at https://news.ycombinator.com/item?id=23915285 https://news.ycombinator.com/item?id=23915285 which was dealing with much the same area.) Instead, you’ll want to implement such snapping with absolute snapping as seen with robbiejs’s example.