@openmrs/esm-form-engine-lib 3.0.1-pre.1652 → 3.0.1-pre.1655

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-form-engine-lib",
3
- "version": "3.0.1-pre.1652",
3
+ "version": "3.0.1-pre.1655",
4
4
  "description": "React Form Engine for O3",
5
5
  "browser": "dist/openmrs-esm-form-engine-lib.js",
6
6
  "main": "src/index.ts",
@@ -169,13 +169,6 @@ const UiSelectExtended: React.FC<FormFieldInputProps> = ({ field, errors, warnin
169
169
  itemToString={(item) => item?.display}
170
170
  selectedItem={selectedItem}
171
171
  placeholder={isSearchable ? t('search', 'Search') + '...' : null}
172
- shouldFilterItem={({ item, inputValue }) => {
173
- if (!inputValue) {
174
- // Carbon's initial call at component mount
175
- return true;
176
- }
177
- return item.display?.toLowerCase().includes(inputValue.toLowerCase());
178
- }}
179
172
  onChange={({ selectedItem }) => {
180
173
  isProcessingSelection.current = true;
181
174
  setFieldValue(selectedItem?.uuid);
@@ -252,18 +252,27 @@ describe('UiSelectExtended', () => {
252
252
  );
253
253
  });
254
254
 
255
- it('should filter items based on user input', async () => {
255
+ it('should display all items regardless of user input', async () => {
256
256
  await act(async () => {
257
257
  renderForm();
258
258
  });
259
259
 
260
- const transferLocationSelect = await findSelectInput(screen, 'Transfer Location');
260
+ const transferLocationSelect = await findSelectInput(screen, 'Transfer Location');
261
+ // Open the dropdown
261
262
  await user.click(transferLocationSelect);
263
+
264
+ // Verify all items are displayed initially
265
+ expect(screen.getByText('Kololo')).toBeInTheDocument();
266
+ expect(screen.getByText('Naguru')).toBeInTheDocument();
267
+ expect(screen.getByText('Muyenga')).toBeInTheDocument();
268
+
269
+ // Type input
262
270
  await user.type(transferLocationSelect, 'Nag');
263
-
271
+
272
+ // Verify all items are still displayed
273
+ expect(screen.getByText('Kololo')).toBeInTheDocument();
264
274
  expect(screen.getByText('Naguru')).toBeInTheDocument();
265
- expect(screen.queryByText('Kololo')).not.toBeInTheDocument();
266
- expect(screen.queryByText('Muyenga')).not.toBeInTheDocument();
275
+ expect(screen.getByText('Muyenga')).toBeInTheDocument();
267
276
  });
268
277
  });
269
278