-
Notifications
You must be signed in to change notification settings - Fork 407
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
Override showing of placeholder on Multiple Input selection #684
Comments
@ericgio can you please help review the above feature request 🙏 ? |
Hi @happysomani, thank you for the feature request. It's a reasonable one; I think the best approach would be to move the placeholder logic up to the main Typeahead component. That would allow developers like yourself to render the multi-select input using |
I may not have understood your recommendation around the implementation approach. Can you please explain in slightly more detail please? |
@happysomani: Sorry for not being clear, my comment was mostly a note to myself. I'm suggesting moving the line you highlighted up to here. That would keep the current behavior by default, but allow you to use the |
I can make the change and submit a pull request if you would prefer that. |
@happysomani also interested in this functionality |
This would greatly enhance usability. +1 from me!!!! |
Fixed in v6.0.0-rc.1. You can override the default behavior using <Typeahead
...
renderInput={(inputProps) => (
<TypeaheadInputMulti {...inputProps} />
)}
/> |
Is your feature request related to a problem? Please describe.
I would like to show a placeholder in the input even if a user has selected a few items previously. Currently in the code here the code clears out the placeholder text if the length of the selected items is greater than zero.
But for e.g. The default placeholder text could be "Search for states..." when there is no state selected. Once a user has some state selected in the typeahead box, I may want to update the placeholder text to something like "Search for additional states"
Describe the solution you'd like
Provide an override prop that would always show the placeholder regardless whether the number of selected items is zero or not.
How is this solution useful to others?
Others may be able to also use the placeholder to provide more context to the users using the typeahead.
Describe alternatives you've considered
None.
Additional context
The feature would show up something like this
The text was updated successfully, but these errors were encountered: