iulianraduat / react-select-material-ui

A react SELECT component based on react-select and looking like a material-ui component
MIT License
73 stars 18 forks source link

Can't set object values in MultipleSelect #39

Closed mohitgarg closed 3 years ago

mohitgarg commented 3 years ago

MultipleSelect only pre-fills only if the values is an array of strings. If I am passing an array of objects like you do with selectOptions on onChange, input field doesn't get populated.

Here's the sandbox link: https://codesandbox.io/s/friendly-minsky-xw6il

iulianraduat commented 3 years ago

Hi @mohitgarg,

This is by design. You can take your SelectOptions and extract the values in an array which is provided to MultipleSelect's values prop.

Cheers, Iulian