Closed zoltantakacs-born closed 1 year ago
Hi, in your use case, you could use two ais-hierarchical-menu
widgets:
By doing it this way, you let the widget directly interact with the state instead of overriding it from outside InstantSearch.
You can check out this sandbox for a working example: https://codesandbox.io/s/affectionate-dawn-iw5qd1?file=/src/App.vue.
Thank you for your help @dhayab. This workaround solved my problem š
Good to hear! I'll go ahead and close this issue then.
Bug š
What is the current behavior?
Hello, I try to create a category menu and a hierarchical view containing the subcategories of the active category.
I filter the product list to show the products for the active category only by using
:facet-filters.camel="`hierarchicalCategories.lvl0:${activeCategory}`"
. It works as expected.I also want to narrow down the category tree to show only the subcategories of the active one by using
:root-path="activeCategory"
with theais-hierarchical-menu
component. On the first page load everything looks great, but it stops working after I change the active category by clicking on the 'Video Games' category.Sandbox
What is the expected behavior?
The category tree should be updated to display the subcategories of the new active category.
What is the proposed solution?
I think the problem is with the request which is fired when the value of the root-path prop changes. The request contains the following facet form data:
facets: ["hierarchicalCategories.lvl0"]
The initial request has a different value for this attribute:facets: ["hierarchicalCategories.lvl0","hierarchicalCategories.lvl1"]
Please let me know if there is a better approach to solve my initial problem other than I described above.