cunningham icon indicating copy to clipboard operation
cunningham copied to clipboard

✨(react) add async mode to Select

Open daproclaima opened this issue 1 year ago • 7 comments

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.

daproclaima avatar Mar 15 '24 22:03 daproclaima

⚠️ 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

changeset-bot[bot] avatar Mar 15 '24 22:03 changeset-bot[bot]

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 avatar Jun 21 '24 08:06 jbpenrath

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 2. By testing stories, I feel each time the select value change, the request is executed.

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

jbpenrath avatar Jun 24 '24 14:06 jbpenrath

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 avatar Jun 27 '24 22:06 daproclaima

I'll work on this issue before Friday September 20

daproclaima avatar Sep 10 '24 08:09 daproclaima

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

daproclaima avatar Sep 23 '24 18:09 daproclaima