question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v2 - Conditional refinement lists

See original GitHub issue

Feedback on the v2 alpha version 🆕

Describe the bug / features

Would appreciate some help with this, I’m not sure if I’m doing anything wrong or if this is intended behavior.

We have around half a dozen facets at the moment with more to come. Due to this, the UI we chose is having refinement lists hidden behind a button representing each facet. When the button is clicked, the refinement list shows below the button (think like a dropdown menu). Clicking on the button again closes the list (same as clicking anywhere outside the “box”).

There are 2 main issues with this in v2:

  1. Since there is no searchStore anymore, it is not possible to get easy access to _helper.state.disjunctiveFacetsRefinements or _helper.state.numericRefinements. We need this in order to “detect” if a refinement list is “active” (thus changing the button styling indicating it as active).

  2. When the refinement list is hidden (we use v-show to control visibility) any enabled refinements get removed automatically.

On a related note since there is no more searchStore now there is also no more toggleFacetRefinement method. What is the recommended approach to use instead now?

How to resolve or implement the fix?

  • Do not remove active refinements when a refinement list is hidden

  • Add disjunctiveFacetsRefinements and numericRefinements (we only use these 2, not sure if there are any others that make sense) to the ais-state-results component so they can be used for conditional styling

  • It would also be nice if there was a isActive property or something similar in the ais-state-results component (basically a boolean indicating where any part of Algolia is active; a query is present, or a refinement etc), though if the above is implemented this is simple enough to do on our own

What is the version you are using?

v2.0.0-beta.3

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:21 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
samousscommented, Feb 28, 2019

Hi @tcmorris, the issue you described might be linked to this one: https://github.com/algolia/vue-instantsearch/issues/575. Could you avoid to inline the sort-by attribute? You can store the value on the instance, it should solve the issue.

2reactions
pix2Dcommented, May 6, 2019

Just wanted to report back that not inlining :sort-by per @samouss fixed the second issue. And a custom connector gets access to the underlying helper like before. Cheers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conditionally Display Refinement List Depending on Selected ...
I want my refinement lists to show only if a certain parent item in the hierarchical menu is selected.
Read more >
Actions, resources, and condition keys for AWS WAF V2
Actions Description Access level Reso... CreateIPSet Grants permission to create an IPSet Write ipset* CreateIPSet Grants permission to create an IPSet Write CreateRegexPatternSet Grants permission to...
Read more >
3D Shape Detailization by Conditional Refinement - arXiv
We demonstrate that our method can refine a coarse shape into a variety of detailed shapes with different styles. The generated results are ......
Read more >
Conditions with flow variables | Apigee Edge
Variables; Example 1; Example 2; Test the conditional flow ... For a complete list of conditionals, see Conditions reference.
Read more >
React InstantSearch RefinementList transformItems not working
So I have successfully implemented the React InstantSearch library in my app, and am trying to apply a filter to the refinement list...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found