Skip to content

Form unmounting causes data objects to be cleared #285

@twitwi

Description

@twitwi

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

    <FormulateForm v-if="here" v-model="testDB">
      <FormulateInput type="text" name="id"></FormulateInput>
    </FormulateForm>
    <button @click="here = !here">is {{here}}</button>
    {{JSON.stringify(testDB, null, 2)}}
...
  data: () => ({
    testDB: {},
    here: true,
  })

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug reportA submitted bug report, not yet validated.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions