Filter Resets After Page Change
A user applies a filter to search results (e.g. Category = Electronics) and then clicks to the next page. On page 2, the filter is silently dropped and all categories appear — the user is returned to an unfiltered view instead of page 2 of the filtered results. This happens because the pagination link is built from the page number only, discarding the active filter query parameters.
LowBeginnerManual testingExploratory testing
// UNDERSTAND
// Symptoms
- Selecting Category = 'Electronics' and navigating to page 2 shows all categories instead of page 2 of Electronics results
- The URL changes from /products?category=electronics&page=1 to /products?page=2, dropping the category parameter
- The result count jumps from the filtered count (e.g. 47 Electronics items) back to the total count (e.g. 312 items) when changing pages
- The filter pill or checkbox still appears selected in the UI after the page change, even though the filter was silently dropped from the query
- Returning to page 1 from page 2 also loses the filter
// Root Cause
- The pagination 'next page' link is constructed using only the page number parameter, without reading and preserving the other active query parameters (category, price_min, sort, etc.) in the URL
- The filter state is stored in React component-local state instead of being reflected in the URL. When the user navigates to a new page URL, the page component re-mounts and its local state resets to the default (no filter), even though the component renders the previously selected filter label from a stale prop
// Where It Appears
- E-commerce product catalogue pages with category, price, and brand filters
- Admin dashboards with status or date-range filters over paginated data
- Search results pages where filters are applied via sidebar checkboxes or dropdowns
- Any paginated list where filter parameters are not persisted in the URL
// REPRODUCE & TEST
// How to Reproduce
- 01Navigate to /products
- 02Apply the Category filter: select 'Electronics'; confirm the URL becomes /products?category=electronics&page=1 and the results list shows only Electronics items
- 03Click the Next Page button or the page 2 link in the pagination control
- 04Observe the new URL and the results list
- 05Confirm whether the URL contains category=electronics — if it is absent, the filter has been dropped
// Test Data Needed
- A product catalogue with at least 20 products, more than 10 of which belong to the 'Electronics' category (so that a second page of filtered results exists)
- Access to the /products page with a working Category filter
// Manual Testing Ideas
- Apply multiple filters simultaneously (category=electronics&price_min=50) then navigate to page 2 and confirm all filter parameters are preserved in the URL
- Apply a filter, click page 2, then click page 1 and confirm the filter is still active on the return trip
- After the bug manifests, check the URL bar to confirm which query parameters were dropped — this pinpoints whether the issue is in the link builder or the component state
- Test each filter type individually (category, price range, sort) to identify which ones reset on page change and which persist
- Test with the browser's Back button after a page change to verify whether the filter was ever part of the browsing history
- Check the filter UI (checkboxes, pills) after navigating to page 2 — a filter that appears selected but returns unfiltered results signals a state-vs-URL mismatch
// Automation Idea
Write a Playwright test that navigates to /products, selects the 'Electronics' category filter, and waits for the URL to contain category=electronics. Then click the page 2 pagination link and assert the resulting URL still contains category=electronics. Also assert the page 2 results include only Electronics items (e.g. by checking a category label on each card). Fail the test if the URL loses the filter parameter or the results revert to all categories.
// Expected Result
After applying Category = 'Electronics' and navigating to page 2, the URL is /products?category=electronics&page=2 and the results contain only Electronics items.
// Actual Result (Example)
After applying Category = 'Electronics' on /products?category=electronics&page=1 and clicking the page 2 link, the URL changes to /products?page=2 (category parameter dropped) and all 312 products appear instead of the 47 Electronics items.
// REPORT IT
Example Bug Report
- Title
- Category filter resets to 'All' when navigating from page 1 to page 2 on /products
- Severity
- Low
- Environment
- Staging environment Chrome 124 Product catalogue with 312 products (47 in Electronics category) Not logged in
- Steps to Reproduce
- 01Navigate to /products
- 02Select 'Electronics' from the Category filter
- 03Confirm the URL is /products?category=electronics&page=1 and 47 results are shown
- 04Click the 'Next Page' button in the pagination control
- 05Observe the URL and the results list on page 2
- Expected Result
- URL is /products?category=electronics&page=2 and only Electronics items are shown.
- Actual Result
- URL changes to /products?page=2 (category parameter dropped) and all 312 products appear. The Category filter chip still shows 'Electronics' selected in the UI, but the results are unfiltered.
- Impact
- Users who apply filters to navigate a large catalogue cannot page through filtered results. They must reapply the filter on each page, making the filter feature unusable for catalogues that span multiple pages.