Skip to content

Commit f34fc0c

Browse files
committed
making sure sentinel is rendered even when empty
for cases like Listbox in Combobox, the content area is actually 0 since we dont have a height on the listbox nor does it reserve room like table layout
1 parent d98691f commit f34fc0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-aria-components/src/Virtualizer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ function CollectionRoot({collection, persistedKeys, scrollRef, renderDropIndicat
102102
onScrollEnd: state.endScrolling
103103
}, scrollRef!);
104104

105-
if (state.contentSize.area === 0) {
105+
// TODO: wull have to update this when multi section loading is implemented, will need to check if all items in a collection are loaders instead perhaps
106+
let hasLoadingSentinel = collection.size === 1 && collection.getItem(collection.getFirstKey()!)!.type === 'loader';
107+
if (state.contentSize.area === 0 && !hasLoadingSentinel) {
106108
return null;
107109
}
108110

0 commit comments

Comments
 (0)