VirtualScroller: acknowledge end of load
Fixes urbit/landscape#507
@@ -456,8 +456,10 @@ export default class VirtualScroller<T> extends Component<VirtualScrollerProps<T
const transform = isTop ? 'scale3d(1, 1, 1)' : 'scale3d(1, -1, 1)';
- const atStart = this.props.data.peekLargest()?.[0].eq(visibleItems.peekLargest()?.[0] || bigInt.zero);
- const atEnd = false;
+ const loaded = this.props.data.size > 0;
+
+ const atStart = loaded && this.props.data.peekLargest()?.[0].eq(visibleItems.peekLargest()?.[0] || bigInt.zero);
+ const atEnd = this.loaded.top;
return (
<>
