-
Notifications
You must be signed in to change notification settings - Fork 241
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
Form unmounting causes data objects to be cleared #285
Comments
That behavior is intentional, but if you're using Formulate >= 2.4.4 you can add Check it out: |
Ok thanks, that's great. For (my) future reference, I share a code pen that adds this property both on the form and on the nested (repeated) inputs, with a schema. |
Sorry to bother you again. |
@justin-schroeder Playing with this and it seems like an issue. I've created a reproduction with both repeatable and non-repeatable form elements here. Both are generated from a schema. https://codepen.io/boyd/pen/KKMpLWm Of note, if you add a repeatable element to the second form (the outer-most repeater) the second object is preserved (it's not reset to a single object in the array) but the contents are indeed not preserved. |
Yeah, |
Makes sense. Let's put a warning in the docs for now at least. @twitwi thanks for bringing attention to this. Sorry we cannot support it at this immediate time. |
Ok thanks for having taken the time to have a look. I understand it requires more thinking given the complexity of the changes. (I closed the other issue I had opened on this subject). |
I turned the
on unmount the data in values will be updated with My code:
|
Describe the bug
When a form gets unmounted (in my original encounter due to routing and with a schema, in the below example, with a v-if and no schema), the data to which it is bound with v-model get cleared.
To Reproduce
Reproduction
Here is a codepen with the above form
https://codepen.io/twitwitwi/pen/oNLgVwB
Expected behavior
Filled data should be preserved when the forms get unmounted.
The text was updated successfully, but these errors were encountered: