Skip to content

Fix FilterForm showing added filters in arbitrary order - #11406

Merged
fzaninotto merged 1 commit into
marmelab:masterfrom
lprnmns:codex/fix-filter-form-order
Oct 16, 2026
Merged

fzaninotto merged 1 commit into
marmelab:masterfrom
lprnmns:codex/fix-filter-form-order

Conversation

@lprnmns

@lprnmns lprnmns commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Problem

The “Add filter” button displays a newly selected filter in its original JSX position, not after the filters the user already added. This reproduces #9225.

Solution

Render visible filters in displayedFilters insertion order, while keeping always-on and value-only filters ahead of the user-added filters. The persisted displayedFilters object and list controller remain unchanged, so existing URL and saved-query data retain their format. This is narrower than the earlier, closed #9281 proposal, which changed the underlying state structure.

How To Test

  • The two new ordering tests fail on the current implementation and pass with this change; one exercises the FilterButton click flow.
  • corepack yarn test-unit-ci packages/ra-ui-materialui/src/list/: 24 suites, 222 tests passed.
  • corepack yarn workspace ra-core build and corepack yarn tsc --noEmit --project packages/ra-ui-materialui/tsconfig.json: passed.
  • Targeted ESLint, Prettier check, and git diff --check: passed.

Additional Checks

  • Targets master for a bug fix.
  • Includes unit and interaction tests.
  • No new story: existing components and props are unchanged.
  • No documentation change: no public API or data-format change.

Closes #9225.

@fzaninotto
fzaninotto merged commit 181013c into marmelab:master Oct 16, 2026
14 checks passed
@fzaninotto

Copy link
Copy Markdown
Member

Awesome, thanks for taking the time to address this long-standing issue!

@fzaninotto fzaninotto added this to the 5.15.5 milestone Oct 16, 2026
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.

FilterButton adds filter in arbitrary order

2 participants