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

Single click to clear search field #576

Closed
bmm-brobbins opened this issue Jun 29, 2022 · 2 comments · May be fixed by #589
Closed

Single click to clear search field #576

bmm-brobbins opened this issue Jun 29, 2022 · 2 comments · May be fixed by #589
Labels

Comments

@bmm-brobbins
Copy link

Is your feature request related to a problem? Please describe.
After searching, must manually clear search field, via e.g. highlight+delete or backspacing.

Describe the solution you'd like
Proposal for an 'x' to appear at right of search field to enable single-click clearing of search contents.

Describe alternatives you've considered
Haven't found a solution here or the usual forums.

Additional context
Any pointers or code to accomplish this feature in the interim using lib's existing capabilities and/or an HOC would be great.
I'm using inlineSearchInput, btw.
P.s. Great lib, thank you for publishing it.

@mrchief
Copy link
Collaborator

mrchief commented Jul 6, 2022

@bmm-brobbins I think it's a fair use case but implementing it is bit more than trivial. Apart from the likely UX confusion that extra x may create on smaller viewports, we also need to figure out accessibility aspect of it - that includes keyboard nav, tab focus order etc.

There is something you can do though to mimic the functionality:

  • create your own wrapper control that puts the x in the input box (use CSS to position it)
  • on click of this button, you programmatically reset the data (in effect wiping out all selections)

@github-actions
Copy link

github-actions bot commented Aug 5, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

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