Skip to content

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

@atheleron

Description

@atheleron

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
       }
   }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions