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

result list with hits get reset when component with “useSortBy” hooks is closed #3635

Closed
rosnk opened this issue Sep 24, 2022 · 1 comment

Comments

@rosnk
Copy link

rosnk commented Sep 24, 2022

I am using "import { useSortBy } from "react-instantsearch-hooks", to create a sortby dropdown in expo project(react native). This sort by component is inside parent component, which opens like model.

Problem: sorting works fine while i open the filter component and choose different filter(ex by price desc, price asc), but as soon as i close the model, whole shorted list result is reset... basically result does not stick to the my choosen sorted result.

video: https://youtu.be/J5uZF01lVtU

pic1: before any sorting, results are as in pic:

pic2: i click the filter, which shows component similar to model, where i can choose dropdown filter, results after i click desc(which is working fine while, filter screen is still showing):

pic3: once i click the filter icon to remove the filter screen, result does not stick to price by desc, it resets to original result:

here is the source code in snack: https://snack.expo.dev/@rosnk/algoli_sortby_example_buggy

note: ( snack code is perfectly fine.... snack is showing error on import line of algolia... that is on this line: import { InstantSearch } from "react-instantsearch-hooks";

@Haroenv Haroenv transferred this issue from algolia/algoliasearch-client-javascript Sep 25, 2022
@FabienMotte
Copy link
Contributor

We're doing a round of cleanup before migrating this repository to the new InstantSearch monorepo. This issue is a duplicate of algolia/instantsearch#5240 so we're going to close it.

Two possible workarounds are listed here: algolia/instantsearch#5240

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants