inveniosoftware / react-searchkit

React component library for interacting with a REST API.
https://inveniosoftware.github.io/react-searchkit/
MIT License
78 stars 40 forks source link

Reset button for SearchBar #183

Closed ksuess closed 2 years ago

ksuess commented 3 years ago

Describe the solution you'd like

An optional reset button to empty the search field would be nice.

Describe alternatives you've considered

Maybe you have a hint for overriding this component? Im stuck with addressing the store; updateQueryState?

jrcastro2 commented 3 years ago

Thanks a lot for the suggestion, one possible solution would be adding a X icon at the end. image What do you think about this solution?

As for overriding the Searchbar you would need to override the Input component (check code here) using react-overridable (documentation with examples available here).

ksuess commented 3 years ago

Thanks for your response. I do like your suggested solution / mockup. I wish I could have already placed a PR for this. But I need some more experience with react-overridable. Despite I already achieved to override some other components and got a really nice looking faceted search for https://github.com/plone/volto Thanks a lot for this great searchkit package! Hope to give something back…

May I also suggest to make the x-Icon overridable. I think this is important for theming.

image

ntarocco commented 2 years ago

Thank you! It looks like we can close this issue now :)