-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[DateInput] defaultValue does not override value from record #10474
Comments
Also, slightly related. The documentation is misleading on page https://marmelab.com/react-admin/DateInput.html Where it says
That should replaced by
like the js docs, because the parse prop is for the output not the input |
Hi,
That's not how it works. Default values are only used when the value from the record is undefined. Regarding the issue documentation, can you open a PR to fix it? |
Ok gotcha, what do you recommend to manipulate the value from record? depending on the answer, I can raise a PR for the docs no problem 👍🏻 |
It depends on your use case. Can you explain what you're trying to achieve? |
It's the answer to this question/problem of the docs:
Currently the answer is
But parse is to manipulate the value on change, not the value incoming from the record on initial display. |
What you were expecting:
if the value of the field from dataprovider is A and defaultValue is B - I expect B to override A
What happened instead:
Value from data provider always wins.
Steps to reproduce:
Follow the examples from jsDoc
source always wins over defaultValue
CODE
RESULT (data from source)
Environment
The text was updated successfully, but these errors were encountered: