Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Refinement list / tree menu with vue-router #357

Closed
wojtekmieszczak opened this issue Nov 11, 2017 · 5 comments
Closed

Refinement list / tree menu with vue-router #357

wojtekmieszczak opened this issue Nov 11, 2017 · 5 comments
Labels

Comments

@wojtekmieszczak
Copy link
Contributor

Do you want to request a feature or report a bug?

Report a bug.

Bug: What is the current behavior?

I'm using vue-instantsearch along with vue-router to make a simple SPA. There are some refinement list and tree menu components on the search page. After clicking on any router link, even outside of index component, it is behaving as if I'm clicked on refinement list / tree menu item. The numer of requests depends on the number of components. Let's say I have 3 tree menus and 2 refinement lists, then there will be 5 (identical) requests.

Bug: What is the expected behavior?

There should be no requests.

Bug: What browsers are impacted? Which versions?

All.

What is the version you are using? Always use the latest one before opening a bug issue.

1.3.1

@Haroenv
Copy link
Contributor

Haroenv commented Nov 11, 2017

Can you make a small replication in a repo, it will be a lot more straightforward to see which situation you are hitting

@wojtekmieszczak
Copy link
Contributor Author

Sure, here you go: https://github.com/salparadise/vue-instantsearch-spa

If you navigate to search page and then navigate back to home page, you will see that on "Home" click two requests are being made.

@Haroenv
Copy link
Contributor

Haroenv commented Nov 11, 2017

perfect, will take a look at that soon

@rayrutjes rayrutjes added the bug label Nov 11, 2017
@rayrutjes
Copy link
Member

Just tried it, and I consider it is a bug.

What happens is that when search components gets destroyed, we remove facets from the search store. This triggers a search operation because the query parameters changed.

Here we probably need to either:

  1. not remove anything when components get destroyed
  2. stop the store before removing the facet

Should be a quick fix.
I'll go with 1. for now has it will introduce less changes.

@rayrutjes
Copy link
Member

I tried #359 with your example @salparadise and it works ;)

Haroenv pushed a commit to algolia/instantsearch that referenced this issue Dec 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants