Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow displayOption function to return an element #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vilppuvuorinen
Copy link

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.

* Option allows elements as children
* Typeahead's _onOptionSelected converts optionString into a string using toString if given value is not a string
@vilppuvuorinen
Copy link
Author

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

@gregeinfrank
Copy link
Contributor

@fmoo any plans to support this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants