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
The form does not reset when it contains an array of objects #553
Comments
This is fixed in #575! 🙌 |
Versions: same problem as issue starter. form.reset() not working on empty array. I have to manually set it to empty array again |
This problem persists on |
Going to reopen this one to remind myself to have another look. In the meantime, if you're able to provide a minimal reproduction as a Git repo that would be much appreciated. |
Tried it again without the array and it has the same issue. I replicated the issue on the form page of https://github.com/yoeriboven/inertia/tree/form-reset Submit the form and then click the reset button. It won't work. Our setup is a bit more complex but I hope this is the same issue. 111.mov |
@yoeriboven great, thanks for sharing, we'll have a look at this 👍 |
Hey @yoeriboven, Your scenario is a bit different to the original issue. In your case, the behaviour you're experiencing is intentional. Once the form has been submitted, the default form state is updated to the submitted state because that is typically what you'd want on an edit form, where resetting it should reset it back to the current state on the server. There are two things you can do here.
|
@bayangan we were not able to replicate this with an empty array. If you can provide a minimal reproduction repository then we can take another look. Going to close this one for now. |
Versions:
@inertiajs/inertia
version: 0.8.5@inertiajs/inertia-vue3
version: 0.3.5Describe the problem:
The form does not reset when it contains an array of objects.
Steps to reproduce:
The form will not reset and still contains the pushed items.
The text was updated successfully, but these errors were encountered: