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

Support React Element as optionText in AutocompleteInput #3630

Closed
yelworc opened this issue Aug 30, 2019 · 1 comment
Closed

Support React Element as optionText in AutocompleteInput #3630

yelworc opened this issue Aug 30, 2019 · 1 comment

Comments

@yelworc
Copy link
Contributor

yelworc commented Aug 30, 2019

Is your feature request related to a problem? Please describe.
I'd like to apply some simple custom formatting to the choices displayed in an AutocompleteInput (so the available values are presented the same way as in other places, e.g. in a list view).

Describe the solution you'd like
Other input elements (e.g. SelectInput) allow passing a React Element as the optionText prop, which enables flexible customization of the way the values are rendered. AutocompleteInput only accepts a string (choice field name) or a function returning a string in that prop.

Additional context
I'm guessing it currently only works with plain strings is because there is already some formatting applied to the autocompleted choices (highlighting of the matching substring). A custom element passed as optionText would have to implement that itself, if desired.

I checked the reimplemented AutocompleteInput in the latest v3 branch, but this particular aspect seems to be unchanged so far.

@fzaninotto
Copy link
Member

Fixed by #3683

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

No branches or pull requests

3 participants