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

NullableBooleanInput defaultValue not working #6000

Closed
wmwart opened this issue Mar 5, 2021 · 1 comment · Fixed by #6002
Closed

NullableBooleanInput defaultValue not working #6000

wmwart opened this issue Mar 5, 2021 · 1 comment · Fixed by #6002
Labels

Comments

@wmwart
Copy link

wmwart commented Mar 5, 2021

What you were expecting:
Expected to be able to set a default value for the fields as stated in the documentation

What happened instead:
This does not work

Steps to reproduce:

  1. Set the default as in the documentation
  2. No reaction

Related code:

<NullableBooleanInput source="commentable" defaultValue={true} />
<NullableBooleanInput source="commentable" defaultValue={false} />
<NullableBooleanInput source="commentable" defaultValue={null} />

https://codesandbox.io/s/old-firefly-879dr?file=/src/posts/PostCreate.tsx:2648-2713

Other information:
In the codesandbox example, there was some kind of crutch passing the defaultValue for BooleanInput. does not look like in the documentation
https://marmelab.com/react-admin/CreateEdit.html#per-input-default-value

Environment

  • React-admin version: 3.13.1
@djhi
Copy link
Collaborator

djhi commented Mar 5, 2021

Reproduced. 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.

2 participants