I want to setState() by onChange of the Dropdown
The state should be set and the dropdown should change its value.
The selected option should be active and selected
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
0.75.1
You should use the Dropdown as controlled component, codesandbox.
Thanks, but it seems like that does not help! Could you check my sandbox one more time, maybe I am doing something wrong?
https://codesandbox.io/s/nn2wn70r5j
Thanks, now I understand your problem, my poor display doesn't show issue to me :sob: 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 name, text or content like so:
let options = [
{
text: "1",
value: "1",
content: <span>a</span>
},
...
];
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?