Skip to content

Model inside Array is not cleaned when Condition fails #769

Closed
@doomie999

Description

@doomie999

Expected behaviour

  • Given that a Condition is set on a property inside an Array
  • When the Condition is false
  • Then that property of the Model (that element inside the Array) should be cleaned as per the DestroyStrategy

Actual behaviour

  • That property of the Model (that Element inside the Array) retains any previous value entered, instead of being removed as per the default DestroyStrategy

Gist/Plunker/Demo

Plunker of the bug
The Array contains Objects with several properties:

  • helloText
    • conditional on a property outside the Array
  • foobar
    • used as target of condition
  • fooText
    • conditional on property inside the Array (foobar)
  • barText
    • conditional on property inside the Array (foobar)

Upon filling in helloText, fooText, barText, note that:

  • helloText retains its value even when hello is toggled to false
  • fooText retains its value even when foobar is switched to bar
  • barText retains its value even when foobar is switched to foo

Other notes

I've coded up a small fix for this, and will be adding a Pull Request subsequently.

@json-schema-form/angular-schema-form-lead

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions