-
-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Describe the bug
Hi,
I have 2 search parameters:
- Page: This is used for pagination.
- Ingredients: This is used for filtering shakes by ingredients.
Imagine a user is on page 2 and then selects an ingredient. At this moment, I want to reset the page to "1" to start from the beginning. In fact, this reset may occur each time the filter is updated.
Here's how I achieve this:
const currentPage = queryParam('page', ssp.number(1))
const selectedIngredients = queryParam('ingredients', ssp.array([]), { showDefaults: false })
selectedIngredients.subscribe((value) => {
if (!value) {
return;
}
currentPage.set(1)
})
Unfortunately, the filters stop working with this logic. It becomes impossible to check/uncheck ingredients.
Reproduction
Logs
No response
Metadata
Metadata
Assignees
Labels
No labels