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

Dropdown menu not being properly rendered after options are updated within onInputChange #4361

Closed
zisadlier opened this issue Jan 8, 2021 · 2 comments

Comments

@zisadlier
Copy link

zisadlier commented Jan 8, 2021

Example: https://codesandbox.io/s/react-select-v3-sandbox-forked-03yem

Above, a random list of numbers from 1 to 10 is generated as the options for the Select during onInputChange. You can see that the state variable being supplied to the options prop has the correct value during render, but the dropdown says there are no options. I couldn't really find any existing posts discussing this and the behavior seems incorrect.

It's worth noting that the correct values are displayed in the dropdown after the control loses and regains focus.

@zisadlier zisadlier changed the title Dropdown not being properly rendered after options are updated within inputValueChange Dropdown not being properly rendered after options are updated within onInputChange Jan 8, 2021
@zisadlier zisadlier changed the title Dropdown not being properly rendered after options are updated within onInputChange Dropdown menu not being properly rendered after options are updated within onInputChange Jan 8, 2021
@ebonow
Copy link
Collaborator

ebonow commented Jan 8, 2021

@zisadlier This does not appear to be a bug.

The "No Options" message you are receiving is because there are no options that match the filtered text you have entered since your options are randomly generated 1 digit numbers.

Try this example instead where I have prepended some text to the front and begin typing "Option" to see the options change as you type: Forked codesandbox

@zisadlier
Copy link
Author

@ebonow Ah, thanks. In the actual code I'm having a problem with this the difference between typed text and options was subtle and that confusion prevented me from seeing that fairly obvious behavior.

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

2 participants