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

initialValue defaultValue props no longer work in edit views #6198

Closed
jtomaszewski opened this issue Apr 21, 2021 · 2 comments · Fixed by #6272
Closed

initialValue defaultValue props no longer work in edit views #6198

jtomaszewski opened this issue Apr 21, 2021 · 2 comments · Fixed by #6272
Labels

Comments

@jtomaszewski
Copy link
Contributor

jtomaszewski commented Apr 21, 2021

What you were expecting:

Just as it works in Create, inputs placed inside of a SimpleForm in Edit view, when they have a initialValue / defaultValue prop, I'd expect that value to be used (if the initial value for the given source is null or undefined).

Currently, that default value is shown, but only for first ~10-50ms of form being rendered - and then is set back to undefined.

Steps to reproduce:

Go to https://codesandbox.io/s/cranky-voice-psf4s . See that the default value is not respected in PostEdit view, but it is respected in PostCreate view.

Environment

  • React-admin version: 3.14.3
@fzaninotto
Copy link
Member

Confirmed, thanks for the report.

@fzaninotto fzaninotto added the bug label Apr 29, 2021
@fzaninotto
Copy link
Member

I managed to track this regression to version 3.13.3, so it was probably introduced by #6005

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