Fix <PrevNextButtons storeKey={false}> being ignored - #11371
Merged
fzaninotto merged 1 commit intoSep 14, 2026
Merged
Conversation
usePrevNextController used the stored list params unconditionally:
when storeKey was false, the useStore call fell back to the default
`${resource}.listParams` key, so the pager silently synced with the
list's stored sort and filters instead of relying on its own props.
<List> got the full "disable store interactions" treatment in marmelab#9742;
mirror useListParams here: keep calling useStore unconditionally
(hooks rules), but ignore its value when storeKey is strictly false.
Fixes marmelab#11370
Co-Authored-By: Claude <noreply@anthropic.com>
4 tasks
fzaninotto
approved these changes
Sep 14, 2026
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
<PrevNextButtons storeKey={false}>had no effect — it behaved exactly like omitting the prop (#11370).usePrevNextControllerused the stored list params unconditionally: whenstoreKeywasfalse, theuseStorecall fell back to the default`${resource}.listParams`key, so the list's stored sort and filters leaked into the pager'sgetListcall, overriding thesort,filterandfilterDefaultValuesprops.Solution
Mirror what
useListParamshas done since #9742: keep callinguseStoreunconditionally (hooks can't be conditional), but ignore its value whenstoreKeyis strictlyfalse, falling back to the props-derived defaults. Passing nostoreKey(undefined) keeps the previous behavior of syncing with the list.How To Test
WithoutStoreKeystory and a regression test inPrevNextButtons.spec.tsx: filter a list (stores{ q: ... }undercustomers.listParams), then open a record with<PrevNextButtons storeKey={false} sort={{ field: 'first_name', order: 'DESC' }} />. The pager must issuegetListwithsort: { field: 'first_name', order: 'DESC' }andfilter: {}(position11 / 900), ignoring the stored filter.WithQueryFiltertest covers the opposite (default) behavior: withoutstoreKey, the pager follows the list's stored filter (10 / 50).Additional Checks
masterfor a bugfix or a documentation fix, ornextfor a featureFixes #11370