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

Fix FilterListItem story shows wrong way of resetting a filter #10358

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented Nov 18, 2024

Problem

The FilterListItem story features an example with an empy value using null`:

<FilterListItem
    label="21st"
    value={{ year_gte: 2000, year_lte: null }}
/>

This example doesn't work, as selecting the "21st" filter item doesn't mark it as active.

https://react-admin-storybook.vercel.app/?path=/story/ra-ui-materialui-list-filter-filterlist--full-app

Solution

The right syntax is to use undefined:

<FilterListItem
    label="21st"
    value={{ year_gte: 2000, year_lte: undefined }}
/>

@djhi djhi merged commit a733c6c into master Nov 18, 2024
15 checks passed
@djhi djhi deleted the fix-filterlistitem-story branch November 18, 2024 13:08
@djhi djhi modified the milestones: 5.3.5, 5.4.0 Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants