[currentRefinements] clearsQuery
See original GitHub issueCurrent behaviour
When clearsQuery
is true
, the button for clearing the refinements also clears the query.
However if there are no other refinements, the button doesn’t appear. Also the query is not considered a current refinement, therefore even though it would cleared by the button it doesn’t appear.
Proposed fix
Make the clearsQuery trigger the following changes:
- the clear all button clears the query too (and is visible when only the query is set)
- the query appears as a refinement
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
CurrentRefinements | React InstantSearch - Algolia
<CurrentRefinements // Optional parameters clearsQuery={boolean} ... The CurrentRefinements widget displays the list of currently applied refinements.
Read more >react-instantsearch-dom | Yarn - Package Manager
Behaviour is unchanged, query will be filtered if clearsQuery prop is false. Add the index name to all the current refinements items.
Read more >Instantsearch-itemsjs-adapter NPM | npm.io
The CurrentRefinements widget allows a user to see wich filters are apllied. Parameter, Explanation. clearsQuery, ❌, Do not set this to true, the...
Read more >CurrentRefinements - InstantSearch specs
Widgets: Answers · Breadcrumb · ClearRefinements · Configure · CurrentRefinements · GeoSearch · HierarchicalMenu · Highlight · HitsPerPage · Hits · InfiniteHits ...
Read more >https://raw.githubusercontent.com/samouss/flufykin...
Behaviour is unchanged, query will be filtered if clearsQuery prop is false. * Add the index name to all the current refinements items....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@vvo What I propose is the following: when you choose to activate
clearsQuery
, we should display the query. On the other hand, ifclearsQuery
isfalse
we don’t display the query. This brings consistency to the feature: what you can see is what gets cleared.I did not quite get what you proposed. If the question is is it ok to have the query appears in refinements then I would say yes, as @fabregas4 proposed and showed us.
With that said, let’s see if anyone wants to hide the query afterwards and deal with that once it shows as a need/issue.