Reproduction link
Steps to reproduce
The default values are "Expand to load 4", "Expand to load 5".
- Open the drop-down list
- Open the "Expand to load 1" element.
- The "Expand to load 4" element is loaded. The selected values will change the order, it will become: "Expand to load 5", "Expand to load 4". This is incorrect behavior
- Open "Expand to load 2".
- The "Expand to load 5" element is loaded. The selected values will change the order again
What is expected?
the selected values will not change the order, even if they are not in the drop-down list
What is actually happening?
the selected values change depending on their presence or absence in the drop-down list
| Environment | Info |
| ------------ | ------------ |
| antd | 5.19.3 |
| React | 18.2.0 |
| System | macos Monterey 12.5.1 |
| Browser | Google Chrome 126 |
2条答案
按热度按时间cig3rfwq1#
I think I found a piece of code where this happens.
src/hooks/useCheckedKeys.ts
Сan you add a setting to this case?
oknwwptz2#
It do not keep for perf consideration. But I think keeping the order seems more reasonable.