diff --git a/src/components/inputs/ui-select-extended/ui-select-extended.component.tsx b/src/components/inputs/ui-select-extended/ui-select-extended.component.tsx index a7b721f2..2673e060 100644 --- a/src/components/inputs/ui-select-extended/ui-select-extended.component.tsx +++ b/src/components/inputs/ui-select-extended/ui-select-extended.component.tsx @@ -169,13 +169,6 @@ const UiSelectExtended: React.FC = ({ field, errors, warnin itemToString={(item) => item?.display} selectedItem={selectedItem} placeholder={isSearchable ? t('search', 'Search') + '...' : null} - shouldFilterItem={({ item, inputValue }) => { - if (!inputValue) { - // Carbon's initial call at component mount - return true; - } - return item.display?.toLowerCase().includes(inputValue.toLowerCase()); - }} onChange={({ selectedItem }) => { isProcessingSelection.current = true; setFieldValue(selectedItem?.uuid); diff --git a/src/components/inputs/ui-select-extended/ui-select-extended.test.tsx b/src/components/inputs/ui-select-extended/ui-select-extended.test.tsx index aaabeffd..026fa911 100644 --- a/src/components/inputs/ui-select-extended/ui-select-extended.test.tsx +++ b/src/components/inputs/ui-select-extended/ui-select-extended.test.tsx @@ -252,18 +252,27 @@ describe('UiSelectExtended', () => { ); }); - it('should filter items based on user input', async () => { + it('should display all items regardless of user input', async () => { await act(async () => { renderForm(); }); - const transferLocationSelect = await findSelectInput(screen, 'Transfer Location'); + const transferLocationSelect = await findSelectInput(screen, 'Transfer Location'); + // Open the dropdown await user.click(transferLocationSelect); + + // Verify all items are displayed initially + expect(screen.getByText('Kololo')).toBeInTheDocument(); + expect(screen.getByText('Naguru')).toBeInTheDocument(); + expect(screen.getByText('Muyenga')).toBeInTheDocument(); + + // Type input await user.type(transferLocationSelect, 'Nag'); - + + // Verify all items are still displayed + expect(screen.getByText('Kololo')).toBeInTheDocument(); expect(screen.getByText('Naguru')).toBeInTheDocument(); - expect(screen.queryByText('Kololo')).not.toBeInTheDocument(); - expect(screen.queryByText('Muyenga')).not.toBeInTheDocument(); + expect(screen.getByText('Muyenga')).toBeInTheDocument(); }); });