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

How to disable autoload for async options in version 1.0.0-beta5?

Open lanmengyujing opened this issue 11 years ago • 8 comments

our application is currently using the newest version, and found the autoload option is not working now. We want to disable autoload when react-select initialize. We hope the async loadOptions will only be called when user have input some text on the input.

lanmengyujing avatar Nov 23 '15 10:11 lanmengyujing

Was there a solution to this?

angelinacc avatar Dec 22 '15 22:12 angelinacc

Looks like this prop changed. From CHANGES.md:

`autoload` changed to `minimumInput` and now controls the minimum input to load options

fortybillion avatar Feb 18 '16 17:02 fortybillion

I tested this solution and it appears to be missing a very important case.

I'd like to be able to async-load the default options without forcing user to type any input - but do that only if the user actually interacts with the widgets, e.g. by clicking the dropdown.

However with minimumInput == 0 the load is triggered immediately (even if user does not interact with select), while with minimumInput > 0 when the user clicks the dropdown - it shows nothing

dmk23 avatar May 26 '16 09:05 dmk23

This silent prop change (still undocumented in the README) caused us some serious headaches :D. Some of our unit tests broke because of it, and we couldn't identify the issue. Eventually figured out what was wrong after production users started reporting the bug (of options not loading in a certain situation). Maybe toss the change from autoload -> minimumInput in the README @JedWatson, not just the CHANGES? Or do you want me to submit a PR for that? I think there are a few issues that have been created related to this in one way or another. I only found it by diffing CHANGES between the versions we were using on a whim.

skeet70 avatar Sep 29 '16 01:09 skeet70

autoload -> minimumInput is not just a rename

It is a major change in logic per my above comment ...

dmk23 avatar Oct 01 '16 04:10 dmk23

Did autoload previously fulfill the use case you're talking about in your comment? I know it isn't a rename, but for us, setting minimumInput = 0 duplicated the behaviour we were getting with autoload = true. Either way I was asking for documentation of the change from having autoload to having minimumInput, not just a rename.

It seems like they were swapped back in master in ed8d087d4d5d1c46b0b1f7a11c71eb3949be5dd1

skeet70 avatar Oct 03 '16 15:10 skeet70

No, minimumInput = 0 does not provide very user-friendly behavior, though I have not actually run autoload = true with older version to compare side-by-side

The issue is that if users click a dropdown there are no options to see until they type at least something. This is extremely counter-intuitive and comes across as either "no data" or "broken app"

dmk23 avatar Oct 06 '16 05:10 dmk23

Version 1 of react-select is no longer supported.

In the best interest of the community we've decided to spend the time we have available on the latest version.

We apologise for any inconvenience.

Please see:

  1. v1 to v2 upgrade guide
  2. v1 documentation and examples

jossmac avatar Mar 17 '20 07:03 jossmac