Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to control isLoading and the spinner? #405

Closed
hipertracker opened this issue Aug 24, 2015 · 6 comments
Closed

How to control isLoading and the spinner? #405

hipertracker opened this issue Aug 24, 2015 · 6 comments
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet

Comments

@hipertracker
Copy link

Is there any example which for asynOptions which could display spinner showing up during waiting for the data? I can load options from the server but the field is not showing any spinner. Just no options, until they are available. The original example from README file is too simple.

@mik01aj
Copy link

mik01aj commented Aug 25, 2015

In docs on http://jedwatson.github.io/react-select/ you should see the spinner when typing 'a' in the last box. And you should also see it in your own examples, after the your function from asyncOptions was called, yet before the call to callback(null, {options: [...]}).

@BenJenkinson
Copy link
Contributor

I agree with @hipertracker.

The spinner is not automatically shown when the component is loading the data for the very first time, i.e. when { autoLoad: true }.

I've had a look through the source, and I believe that the method autoloadAsyncOptions(..) needs to set isLoading: true before it tries to load data.

Something like:

    autoloadAsyncOptions: function() {
        this.setState({
            isLoading: true
        });
        this.loadAsyncOptions((this.props.value || ''), { isLoading: false }, () => {
            // update with fetched but don't focus
            this.setValue(this.props.value, false);
        });
    },

@sslotsky
Copy link

I actually have the opposite problem, my loading circle never goes away even after I've selected options. Is this related?

@LAKnoKAL
Copy link

@sslotsky the same shit

@keul
Copy link

keul commented Oct 4, 2019

Related to this: although the official documentation says that you can pass an isLoading prop to the Async select...

Will cause the select to be displayed in the loading state, even if the Async select is not currently waiting for loadOptions to resolve

This is not true. The prop is never read/used by the Async component

@jossmac jossmac added the issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet label Mar 17, 2020
@bladey
Copy link
Contributor

bladey commented Jun 3, 2020

Hello -

In an effort to sustain the react-select project going forward, we're cleaning up and closing old issues.

We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our efforts towards the current major version.

If you aren't using the latest version of react-select please consider upgrading to see if it resolves any issues you're having.

However, if you feel this issue is still relevant and you'd like us to review it - please leave a comment and we'll do our best to get back to you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet
Projects
None yet
Development

No branches or pull requests

8 participants