-
Notifications
You must be signed in to change notification settings - Fork 91
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 'search' as type prop for NcTextField #3190
Conversation
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search Signed-off-by: Louis <6653109+artonge@users.noreply.github.com>
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 adds a second clear button at the trailing end. Not sure how we should go forward here.
One drawback is that this native button cannot be focused.
Maybe if the devs pass in the "search" type we can capture it instead of forwarding it to the input component and take care of the functionality and looks ourselves. So basically displaying the trailing close button and the leading search icon.
Any other ideas?
Signed-off-by: Louis <6653109+artonge@users.noreply.github.com>
Nice catch. I have added a condition to the trainling icon slot. What do you think ? |
I think that our close button is better because
Screen.Recording.2022-09-12.at.09.29.17.movWhat would be the advantages of using the native one? |
If the goal is to have a proper type for the input, and if the browser's close icon is not removable, then I don't see any other solution. @jancborchardt any opinion on the accessibility benefit of using a proper type for search input ? Maybe it is not worth the trouble |
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search