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

FilterOptions break with some internal undefined #410

Closed
sospedra opened this issue Aug 26, 2015 · 2 comments
Closed

FilterOptions break with some internal undefined #410

sospedra opened this issue Aug 26, 2015 · 2 comments

Comments

@sospedra
Copy link

So, if I set up the filterOptions like this (really dummy test, it just remove all the default filters):

filter: function (options, filter, currentValues) {
     return options
}

It breaks and prompt this error:
Uncaught TypeError: Cannot read property 'length' of undefined

This piece of code:

getFirstFocusableOption: function getFirstFocusableOption(options) {
    for (var optionIndex = 0; optionIndex < options.length; ++optionIndex) {
        if (!options[optionIndex].disabled) {
            return options[optionIndex];
        }
    }
},

I've followed the stacktrace and it's always undefined.

Any idea?

@eventhough
Copy link

@edravis It has been awhile but I just tried this in my app and it worked fine. Maybe you were not passing in an empty array to the options prop?

@jossmac
Copy link
Collaborator

jossmac commented Mar 17, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants