reactjs / react-autocomplete

WAI-ARIA compliant React autocomplete (combobox) component
MIT License
2.17k stars 532 forks source link

Why does `getItemValue` has to return string? #260

Closed mir3z closed 7 years ago

mir3z commented 7 years ago

As per title - what if I need to return an object and have this object in onSelect

CMTegner commented 7 years ago

Hi! getItemValue needs to return a string because its return value is used to determine which item to highlight (by matching the input text with the item display value). To retrieve the selected source object when an item is selected, simply use the second argument passed to onSelect.