Value property must be unique / incorrect option passed to onSelect
Demo: https://codesandbox.io/s/exciting-bird-x7m1kf?file=/src/App.js
Steps to reproduce:
- Click to input, dropdown opens;
- Click on first option;
- Click to input again;
- Click on second option;
- Observe console output
Expected behavior: After first click, option with 'key: "id1"' should be passed to onSelect. After second click, option with 'key: "id2"' should be passed to onSelect
Actual behavior: Same option is passed to onSelect (id3) regardless which option I select.
Comment: It's not stated anywhere that value prop must be unique, which in many cases is not satisfying - movies, companies, books etc. can have same name but unique ID. In my case, same values might have highlighted different parts of string - I can not use options prop. I also can not pass id to value, since I need backfill.
One possible solution would be to keep uniqueness only to keys. Other (which will solve only my case) to do backfill with different prop - title, label or something else and fill it with value as a backup.