Skip to content

Commit a4f12d8

Browse files
committed
make loader not sticky, follow S1 design
1 parent 82d998c commit a4f12d8

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/@react-spectrum/s2/src/TableView.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,7 @@ export class S2TableLayout<T> extends TableLayout<T> {
215215
let layoutNode = super.buildLoader(node, x, y);
216216
let {layoutInfo} = layoutNode;
217217
layoutInfo.allowOverflow = true;
218-
layoutInfo.rect.width = this.virtualizer!.visibleRect.width;
219-
// If performing first load or empty, the body will be sticky so we don't want to apply sticky to the loader, otherwise it will
220-
// affect the positioning of the empty state renderer
221-
let collection = this.virtualizer!.collection;
222-
let isEmptyOrLoading = collection?.size === 0 || (collection.size === 1 && collection.getItem(collection.getFirstKey()!)!.type === 'loader');
223-
layoutInfo.isSticky = !isEmptyOrLoading;
218+
layoutInfo.rect.width = this.virtualizer!.contentSize.width;
224219
return layoutNode;
225220
}
226221

0 commit comments

Comments
 (0)