openfun / cunningham

🎨 The Open FUN Design System
https://openfun.github.io/cunningham/
MIT License
23 stars 2 forks source link

✨(react) add async mode to Select #305

Open daproclaima opened 7 months ago

daproclaima commented 7 months ago

Mono-searchable Select fetches options on search update

An uncontrolled and a controlled mono-searchable select component can now take a callback as an options prop to fetch data and format it into an array of options to display.

This PR does not enable the use of async mode on the multi select.

Related to issue 286.

changeset-bot[bot] commented 7 months ago

⚠️ No Changeset found

Latest commit: 13e89dc6937b3de84e6cdbf0b26a3b57f6a886ad

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

jbpenrath commented 4 months ago

Few UI/UX feedbacks :

  1. I think the loading state can be improved
    1. I'll display the loader at the place of the arrow to open the select
    2. I'll disable the select during loading to prevent the user to open the menu
Before After
image image
  1. By testing stories, I feel each time the select value change, the request is executed.

https://github.com/openfun/cunningham/assets/9265241/efec1e87-202d-495a-8790-14fb36d0dafe

jbpenrath commented 3 months ago

Few UI/UX feedbacks :

  1. I think the loading state can be improved

    1. I'll display the loader at the place of the arrow to open the select
    2. I'll disable the select during loading to prevent the user to open the menu

Before After image image

  1. By testing stories, I feel each time the select value change, the request is executed.

    CleanShot.2024-06-21.at.09.59.42.mp4

daproclaima commented 3 months ago

Hi @jbpenrath, @AntoLC. I updated the select mono searchable component according to your feedbacks Jean-Baptiste.

When the component uses options fetching, and we click on the menu toggle button, the menu closes but instantly opens back. I do not find which event opens the menu back. Do you guys have an idea for fixing it?

See video below:

https://github.com/openfun/cunningham/assets/33085077/a01e66f2-420c-4837-b02b-2d59385c5aa9

daproclaima commented 1 month ago

I'll work on this issue before Friday September 20

daproclaima commented 3 weeks ago

I'm on it... with some delay!