Closed bmpf closed 2 years ago
When you put an inline object or array, it will reset when there's a change in the vue state, as it's re-rendering.
Change :items="[...]"
to :items="myItems"
(same for cssClasses), and use those values from data
instead.
Unfortunately this is a limitation of Vue we haven't yet found a solution for.
The answer provided by @Haroenv fix the problem.
Bug 🐞
What is the current behavior?
When there are buttons in the page, the ais-sort-by component reset.
Make a sandbox with the current behavior
Sandbox Code (just copy and past in sandox link) Template: https://codesandbox.io/s/github/algolia/create-instantsearch-app/tree/templates/vue-instantsearch
https://user-images.githubusercontent.com/33966960/155701250-f1fa222b-d8e0-42c4-a501-1c5679f4643b.mp4
What is the expected behavior?
ais-sort-by value cannot change.
Does this happen only in specific situations?
When there is a button in the page and it is clicked.
What is the version you are using?
Latest