Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repair filtering by clearing pagination pointers #39

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MaSchVam
Copy link

The pagination-pointer state cursors that is currently being set with setCursors, seems to be the culprit when it comes to how the filtering breaks sometimes.

This can easily be tested by navigating back and forth on any product archive that has pagination available - followed by entering a search.

A search, or a filtering of the products at this point, will return a data object with 0 products. Odd behaviour also occur, if a filtering is attempted, while not on the first page of any search/filtering result.

By unsetting the navigation pointer state in this side-effect, and by adding the sortKey state to the dependency array, we can fully reset the search archive every time a filter is changed, or a new search is entered.

The pagination-pointer state cursors that is currently being set with setCursors, seems to be the culprit when it comes to how the filtering breaks sometimes. 

This can easily be tested by navigating back and forth on any product archive that has pagination available - followed by entering a search. A search, or a filtering of the products at this point, will return a data object with 0 products.

By unsetting the navigation pointer state in this side-effect, and by adding the sortKey state to the dependency array, we can fully reset the search archive every time a filter is changed, or a new search is entered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant