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

BooleanInput with default value false not working #6269

Closed
burnes opened this issue May 11, 2021 · 4 comments · Fixed by #6338
Closed

BooleanInput with default value false not working #6269

burnes opened this issue May 11, 2021 · 4 comments · Fixed by #6338
Assignees
Labels

Comments

@burnes
Copy link

burnes commented May 11, 2021

What you were expecting:
If I add a new BooleanInput Filter with default value false on a List, I'd expect the list to filter for falsy attributes when adding the filter.

What happened instead:
The list stays the same and still lists items with true and false values.

Steps to reproduce:
Add a BooleanInput with defaultValue false

    <BooleanInput
      source="commentable"
      defaultValue={false}
      label="(Not) commentable"
    />

Select the Input on `Add Filters'.

Related code:

CodeSandbox example:
https://codesandbox.io/s/magical-field-e32pv?file=/src/posts/PostList.tsx:959-1069

Environment

  • React-admin version: 3.12.4
  • React version: 17.0.0
  • Browser: Chrome, all
@djhi
Copy link
Collaborator

djhi commented May 12, 2021

It seems to work on the codesandbox. Did I miss something?

@burnes
Copy link
Author

burnes commented May 12, 2021

@djhi After setting the filter I would expect the list to contain only items where commentable is false (X)

Screenshot 2021-05-12 at 09 46 37

@djhi
Copy link
Collaborator

djhi commented May 12, 2021

Nevermind, reproduced it this time

@djhi djhi added bug and removed needs more info labels May 12, 2021
@djhi
Copy link
Collaborator

djhi commented May 12, 2021

Thanks for the report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants