Skip to content

Commit

Permalink
SearchBar: reset button to reset all (qs and filter)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuess committed Apr 25, 2021
1 parent 9efa800 commit aeeeb73
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/Views/FacetedSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,17 @@ const FacetedSearch = ({ data }) => {
// console.log('searchstring reseted');
// };

const payloadOFReset = {
searchQuery: {
sortBy: 'bestmatch',
sortOrder: 'asc',
layout: 'list',
page: 1,
size: 10,
queryString: '',
},
};

return (
<Segment vertical>
{__CLIENT__ && (
Expand Down Expand Up @@ -483,6 +494,12 @@ const FacetedSearch = ({ data }) => {
}}
uiProps={{ icon: 'search', iconPosition: 'left' }}
/>
<Icon
basic
icon
name="delete"
onClick={() => onQueryChanged(payloadOFReset)}
/>
</Portal>
) : (
<Grid relaxed style={{ padding: '2em 0' }}>
Expand Down

0 comments on commit aeeeb73

Please sign in to comment.