question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Async options without a label or value don't work on a multi-select

See original GitHub issue

We’ve been using a dataset with react-select that loads each record with an id and a display_value. As the entire object is passed up from react-select in the onChange event, until now we have just looked for those fields on the way in and out using a custom formatOptionLabel and a custom filter.

Today for the first time I attempted to use this dataset in a <Select> with isMulti set. After selecting the first option, everything vanished from the dropdown.

Eventually I tracked this down to buildFocusableOptions and have now worked around this by mapping the id to value but it would be helpful to have this requirement documented somewhere!

See example code here

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
jymbobcommented, Mar 13, 2021

Just to confirm, adding a getOptionValue does return me to expected behaviour

On Fri, 12 Mar 2021, 04:16 Eric Bonow, @.***> wrote:

This doesn’t appear to be an issue with the library so I will close this issue, but please feel free to reply if you come across any other issues or have some constructive feedback on where or how to better document what you were looking for.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JedWatson/react-select/issues/4488#issuecomment-797223187, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7U2FJFXVOTJJSQB4KJXGTTDGBSRANCNFSM4ZAU6EHA .

0reactions
ebonowcommented, Mar 12, 2021

This doesn’t appear to be an issue with the library so I will close this issue, but please feel free to reply if you come across any other issues or have some constructive feedback on where or how to better document what you were looking for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set value / label of Asynchronous select · Issue #526 - GitHub
I am sure this is a simple thing, but I can't seem to figure it out from the docs. How do I set...
Read more >
React-Select Async loadOptions is not loading options properly
I mean there blank options loaded, no text value. yes you are right, is a synchronous method returning a string, i don't need...
Read more >
React Select with options outside - Prepsheets
Moving selected options to outside the select. The next step is to not show the selected values in the select but rather above...
Read more >
React-Select | A flexible and beautiful Select Input control for ...
Multiselect Single Value. This example implements custom label and value properties, async options and opens the github profiles in a new window when...
Read more >
Async Data Fetching with React-Select - OpenReplay Blog
With it, we will demonstrate different select options such as singe, multi-search, and creatable search in which users can create non-existing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found