Search terms get deleted when picking a value in Asyncselect #4904
Unanswered
cubecleveland
asked this question in
Q&A
Replies: 2 comments
-
The "search terms" or menu items are intended to be dependent on the input value when using an AsyncSelect. If you would like to retain the options, perhaps a regular Select would work better for you? const [ options, setOptions ] = useState();
useEffect(() => {
if (!options) {
fetchOptionsFromApi().then(resp => setOptions(resp));
}
}, []);
return <Select isLoading={!options} options={options} {...otherProps} /> Otherwise, you would have to retain the inputValue or repopulate it onFocus, though I forget if there is still an issue with programmatically entering an inputValue and getting the loadOptions. |
Beta Was this translation helpful? Give feedback.
0 replies
-
If we use the select how would we search asyncronouly in the backend when
someone types in the input box ? Do we have to listen to the onChange of the input itself
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Ive noticed the following behaviour : on an async select compoenent when u type a search term the controler shows only the avlue that are search ( expected behaviour) but when actually selecting the value the search terms get deleted and the compoenent changes state back to no serach term... is that the expected behaviour is there any way to go around it....
It make the ux very annoying treying to search for a string that contains a certain value and trying to select all the avlues that match... as u have to keep tyipng the serahc value.,...
Beta Was this translation helpful? Give feedback.
All reactions