react-typeahead icon indicating copy to clipboard operation
react-typeahead copied to clipboard

Allow displayOption function to return an element

Open vilppuvuorinen opened this issue 9 years ago • 2 comments

Relatively small changes to allow using custom element via displayOption prop inside the result list. The entire element will still be rendered inside <a href="#"> ... </a>, but otherwise anything goes. Additionally, displayOption could no longer generate a string representation of the given option object without help. Summary of changes:

  • Option allows elements as children
  • Typeahead's _onOptionSelected converts optionString into a string toString if given value is not a string

Unit tests are included.

vilppuvuorinen avatar Dec 09 '15 10:12 vilppuvuorinen

Looks like there is also a bit more invasive alternative #152.

vilppuvuorinen avatar Dec 21 '15 09:12 vilppuvuorinen

@fmoo any plans to support this?

gregeinfrank avatar May 24 '16 04:05 gregeinfrank