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

[ic-select searchable]: 'No results' styling is not removed when data is loaded asynchronously

Open jd239 opened this issue 1 year ago • 0 comments

Summary of the bug

If data is loaded in asynchronously, the initial state is no results and then populated seconds later. When the IcMenu is open, the mouse cursor still displays the 'not-allowed' icon. This happens if the loading prop is not used. It looks as though the 'no-results' class is stuck on ic-menu

🪜 How to reproduce

Tell us the steps to reproduce the problem:

  1. Use async default story or IcSelect searchable
  2. Remove the loading prop
  3. Run storybook with menu open
  4. Once new data appears in menu, hover over options with mouse
  5. View 'not-allowed' cursor

📸 Screenshots or code

https://github.com/mi6/ic-ui-kit/blob/main/packages/web-components/src/components/ic-select/ic-select.tsx#L1242-L1248

🖥 📱 Device

  • Type: Desktop
  • Device: N/A
  • OS version: N/A
  • Browser version: Chrome 123

🧐 Expected behaviour

The cursor should not be 'not-allowed' and hover state should appear over menu item.

📝 Acceptance Criteria

If relevant, describe in full detail the different interactions and edge cases that the component or patterns needs to fulfil.

Given as a user When data is asynchronously into the menu
Then it should be possible to see a different cursor to indicate the menu option is selectable

Additional info

Tell us anything else useful to help us fix or understand the problem.

jd239 avatar Apr 02 '24 09:04 jd239