-
Notifications
You must be signed in to change notification settings - Fork 4k
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: setState in onChange leads to mismatch of 'active' and 'selected' option #2243
Comments
You should use the |
Thanks, but it seems like that does not help! Could you check my sandbox one more time, maybe I am doing something wrong? |
Thanks, now I understand your problem, my poor display doesn't show issue to me 😭 Looks like problem with indexes, should be checked. Help is much appreciated. |
It looks like the issue is still present in some cases. E.g. passing an element to the content of an option within
will lead to mismatch again. ShowCase: https://codesandbox.io/s/pp0w7wrn7q |
Here's another one which is bugged: https://codesandbox.io/s/xr4xz2x9n4 In the first dropdown, select "3", then "1" and then open the second dropdown. You will see the mismatch. |
should I open a new issue for this? |
Yes, please open a new issue and fully fill the issue template. |
Do we have a fix for this issue? |
Steps
I want to setState() by onChange of the Dropdown
Expected Result
The state should be set and the dropdown should change its value.
The selected option should be active and selected
Actual Result
The state is set as expected
The selected option is set to active, the previously selected option is kept as selected.
=> Selected and active do not match the same option anymore
Version
0.75.1
Testcase
https://codesandbox.io/s/lrvqlpy7oz
The text was updated successfully, but these errors were encountered: