-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat(search-input): added autocomplete #3892
Conversation
Preview: https://patternfly-pr-3892.surge.sh A11y report: https://patternfly-pr-3892-coverage.surge.sh
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, although it feels to me like we should use the menu. Could we keep this dedicated menu with the assumption that later we could promote the menu
and replace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good @mcoker . I don't see a reason to pull in the menu component here. This should never be anything more than a single select list. I'm more concerned that we can't complete the auto-complete text styling. Do you have any idea how others are doing this? Maybe needs more research. We could still support the basic functionality without it. Thoughts?
@mcarrano OK that works, though if we end up wanting to support descriptions or other things, it's a breaking change to use the menu component here instead. We would need to align that update with a breaking change release. That's OK?
Do you have an example of this being used somewhere? Preferably on a desktop device. I checked amazon, search engines, and a handful of places and I couldn't find an instance of the hint text appearing in a search text input field. I can think of a couple of ways off the top of my head to do it though it isn't a very straight forward approach. The easiest way might be to layer text inputs on top of one another, so that a text input underneath the active/top one has the full search term in hint styling (grey text) and that text shows through as you're typing in the top text input. Another way could be to use |
@mcoker yes, I see where this can get really complicated. I did some quick research and most auto-complete components do not support hints like this. But I found two references: https://www.npmjs.com/package/react-autocomplete-hint https://reactjsexample.com/a-react-component-for-autocomplete-hint/ See if these give you any ideas. If this becomes too unwieldy, I'd consider pulling the requirement and perhaps just supporting a keyboard shortcut to auto-complete the term when there is only one remaining option. |
@mcarrano thanks for that! The component used in those pages is the same, but looks like they layer inputs on top of one another like I mentioned above. I'll give that a shot here. |
@mcarrano @mattnolting @jessiehuff added support for hint text. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for figuring out how to implement the hint text @mcoker . This looks good to me!
🎉 This PR is included in version 4.90.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
fixes #3863
@mcarrano