ic-ui-kit icon indicating copy to clipboard operation
ic-ui-kit copied to clipboard

Select options searchable in loading state

Open GCHQ-Developer-718 opened this issue 8 months ago • 0 comments

Summary of the bug

When a searchable select is in a loading state, a user can search against the current options array. The search results are shown in preference to the loadingLabel.

🪜 How to reproduce

  1. Go to the Stackblitz example
  2. Click on the toggle loading button
  3. Type something in the select input and see that the search results appear in preference to the loadingLabel
  4. Delete the search string and see that the unfiltered options array appears in preference to the loadingLabel
  5. Type something in the select input that doesn't match any options and see that the emptyOptionsLIstText appears in preference to the loadingLabel

📸 Screenshots or code

Searchable select with options Searchable select with options

Put it in a loading state - behaves as expected Put it in a loading state - behaves as expected

Start typing - still in a loading state but we now see the filtered options Start typing - still in a loading state but we now see the filtered options

Remove search string - still in a loading state but we now see the unfiltered options array Remove search string - still in a loading state but we now see the unfiltered options array

Type something that doesn't match any options - still in a loading state but we see the emptyOptionsListText Type something that doesn't match any options - still in a loading state but we see the emptyOptionsListText

📝 Acceptance Criteria

If a select is in a loading state, the loadingLabel should always be displayed and not the options.

GCHQ-Developer-718 avatar May 01 '25 09:05 GCHQ-Developer-718