-
-
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 or ArrayInput with warnWhenUnsavedChanges are triggering an alert when submitting the form #5267
Comments
Thanks for reporting this. Can you please provide a sample application showing the issue by forking the following CodeSandbox (https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/simple)? |
@djhi I tried to reproduce the bug on the sandbox with the So there must be something else I'm doing to trigger this error, I'll keep investigate on my side inside my project. But If I don't find anything, I'll close this issue! Thank you! |
@djhi I found how to reproduce it! In my project, I have to remove all of the "Array Inputs" to make it work: <ReferenceArrayInput>
<AutocompleteArrayInput />
</ReferenceArrayInput> and <ArrayInput>
<SimpleFormIterator />
</ArrayInput> So I tried to find one of these cases in the sandbox, and I didn't find the exact same setup, but the same bug, with the example (without doing a fork). You have to pick a When updating only the I'm joining the "video" of the bug in the example, tell me if you need more informations! |
A link to the codesandbox would help |
I didn't need to fork it, the bug in the gif from my previous message, is coming from the example: |
I found out that the issue is not only for the Edit: In my project, when I modify my |
What more infos do I need to give? I can rename and edit the issue, but I simply describe an issue with the example afterall. |
Should be enough, thanks. We now need time to investigate |
I too have the same issue with |
@MLukman Yes, it's not only related with the Date, I have the issue too with |
My theory is that certain form fields dispatch a change event to the react-final-form state, when they are reinitialized after the entity is saved (the backend returns the current values of the saved entity, and fills those into the form). |
I have the same issue after updating the react-admin version from 3.8.2 to 3.11.2. It works for some FormWithRedirect forms and doesn't work for TabbedForms at all. Any news?? |
See #5776 which should be released in next patch version |
Fixed by #5776 |
Hello!
What you were expecting:
I'm using the
warnWhenUnsavedChanges
option on myTabbedForm
, it was working as expected until I add aDateInput
in my form.When I update my date in the form, I don't want to have the "unsaved" alert when I'm submitting my changes.
What happened instead:
DateTimeInput
.Steps to reproduce:
Using the option
warnWhenUnsavedChanges
in aTabbedForm
, with aDateInput
inside it.Related code:
I don't have much code to show, the components are a bit split:
Environment
The text was updated successfully, but these errors were encountered: