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

Select Multiple does not show options #18840

Closed
1 task done
lcorniglione opened this issue Sep 16, 2019 · 5 comments
Closed
1 task done

Select Multiple does not show options #18840

lcorniglione opened this issue Sep 16, 2019 · 5 comments
Assignees

Comments

@lcorniglione
Copy link

lcorniglione commented Sep 16, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Type on select and wait until settimeout resolve the callback. You will see that the option is not displayed into the select.

What is expected?

See the option rendered into the select.

What is actually happening?

The option does not appear.

Environment Info
antd 3.23.2
React 16.8.6
System linux ubuntu
Browser Mozilla

If I change the key of the option to key={it.name} the option is displayed, but I need the id as the key of the option.

@afc163
Copy link
Member

afc163 commented Sep 17, 2019

  onChange = value => {
    console.log(value);
+   this.setState({ value });
  };

@afc163
Copy link
Member

afc163 commented Sep 17, 2019

@afc163 afc163 closed this as completed Sep 17, 2019
@lcorniglione
Copy link
Author

lcorniglione commented Sep 17, 2019

Hi! Thanks for your response.

Maybe I think that I was not clear about the issue. The problem is when I write on the input the handleSearch method is dispatched, but then, the render method is executed again but the option items are not displayed into the Select component. Even though, when I list the options into the select with key={it.name} the options are displayed. Maybe I am wrong but I spect the same behavior in both cases. I will try to illustrate the issue.

Expected behavior

https://www.loom.com/share/1a1cfe82de784912a85c983eddb3c237

Select bug

https://www.loom.com/share/0c60418ca6fd49e4b384e17e1e10654b

@oceandrama
Copy link

@lcorniglione You should use filterOption={false} because Select component filters options itself even with handleSearch

@lcorniglione
Copy link
Author

@oceandrama Thank for your response! That did the trick!

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

4 participants