diff --git a/apis/nucleus/src/components/listbox/ListBox.jsx b/apis/nucleus/src/components/listbox/ListBox.jsx index 9c340bf23..6afe558de 100644 --- a/apis/nucleus/src/components/listbox/ListBox.jsx +++ b/apis/nucleus/src/components/listbox/ListBox.jsx @@ -103,11 +103,13 @@ export default function ListBox({ selectDisabled, layout, }); + } - if (itemsLoader.pages.length && !awaitingFrequencyMax) { - // All necessary data fetching done - signal rendering done! - renderedCallback?.(); - } + const cardinal = layout?.qListObject.qDimensionInfo.qCardinal; + + if ((itemsLoader?.pages.length && !awaitingFrequencyMax) || cardinal === 0) { + // All necessary data fetching done - signal rendering done! + renderedCallback?.(); } const isItemLoaded = useCallback( @@ -307,7 +309,7 @@ export default function ListBox({ return ( - {!listCount && } + {!listCount && cardinal > 0 && } ', () => { test('should render a disclaimer when list count is 0 but should still render a list component', async () => { layout.qListObject.qSize.qcy = 0; + layout.qListObject.qDimensionInfo.qCardinal = 1; await render(); const disclaimers = renderer.root.findAllByType(ListBoxDisclaimer); expect(disclaimers).toHaveLength(1); const listRows = renderer.root.findAllByProps({ className: 'a-value-row' }); expect(listRows).toHaveLength(1); }); + + test('should not render a disclaimer when list count is 0 and qCardinal is 0', async () => { + layout.qListObject.qSize.qcy = 0; + layout.qListObject.qDimensionInfo.qCardinal = 0; + await render(); + const disclaimers = renderer.root.findAllByType(ListBoxDisclaimer); + expect(disclaimers).toHaveLength(0); + }); }); });