Skip to content
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.reset() not working for nested objects #26

Open
atheleron opened this issue Apr 14, 2020 · 1 comment
Open

form.reset() not working for nested objects #26

atheleron opened this issue Apr 14, 2020 · 1 comment

Comments

@atheleron
Copy link

atheleron commented Apr 14, 2020

here is reset part of form class

reset() {     
  for (let field in this.originalData) {
    this[field] = this.originalData[field];
  }
}

If you have form object like this only first level of form is cleared
nested fields inside lte, wcdma and edge are not cleared??

form: new Form({
    contact: '',
    phone: '',
    address: '',
    active: true,
    mesured: {
        lte: {
            cell: '',
            signal: 0,
            download: 0,
            upload: 0
        },
        wcdma: {
            cell: '',
            signal: 0,
            download: 0,
            upload: 0
        },
        edge: {
            cell: '',
            signal: 0,
            download: 0,
            upload: 0
       }
   }
})
@webman2030
Copy link

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants