react-select icon indicating copy to clipboard operation
react-select copied to clipboard

Async select: inputChange bug

Open dinfyru opened this issue 3 years ago • 6 comments

https://react-select.com/async bug on this page and in my project

  1. Write "o"
  2. Wait for an answer
  3. Add "c" and quickly erase "c"

As a result, the list of options will contain the result from entering "oc", but not "o". Works only on fresh load

Video https://youtu.be/jncTy-yxers

dinfyru avatar Dec 26 '21 06:12 dinfyru

Need more information?

dinfyru avatar Feb 10 '22 09:02 dinfyru

Hi @dinfyru I looked into this problem, it's because the setTimeout code set in the example docs it's in docs/examples/AsyncCallbacks.tsx lines 20-22 If you don't use setTimeout in your app, then it should be fine

image

idiglove avatar Jun 27 '22 12:06 idiglove

Hi @idiglove . I need setTimeout

dinfyru avatar Jul 09 '22 06:07 dinfyru

Any news?

dinfyru avatar Oct 18 '22 05:10 dinfyru

Hey @dinfyru If you want the setTimeout, you can execute the function loadOption, making closure with the value of 'inputValue'. So when timeout ends, and function is ready to execute we have value, that user typed. It will execute a function on each 1 second with the input value.

kunal8411 avatar Mar 28 '23 18:03 kunal8411

I was working on a fix to this issue, but had to close it due to an strange issue with the workflow pipeline. If no one is working on it, I can rebase my branch and reopen my PR

feder240516 avatar Feb 04 '24 20:02 feder240516