JedWatson / react-select

The Select Component for React.js
https://react-select.com/
MIT License
27.42k stars 4.1k forks source link

getOptionValue is called with wrong type #5899

Open mahdix opened 2 months ago

mahdix commented 2 months ago

Thanks for using react-select!

If you are going to ask a question or want to propose a change or a new feature, then please don't file an issue for this. Questions and feature requests have their own place in our discussions section.

Are you reporting a bug or runtime error?

react-select v5.8.0 react v18.2.0

I'm trying to use Creatable with getOptionLabel and getOptionValue. But when the "create ..." item wants to be shown, my getOptionValue is called with an unexpected input (I expect my own data type, but it is a string: 'Create item ...')

So, If I type something that does not exist in the options list, the "Create ..." label is not shown, instead it shows empty line.

image

Forked PoC: CodeSandbox