Skip to content

DestroyStrategy option is not working properly #703

Closed
@warmy1004

Description

@warmy1004

Enhancement

In my case, three conditional questions (text, select, and radios-inline types) are showing and hiding based on the main question's value. Any previously entered input for these conditional questions should be removed or set to be empty when these conditional questions are removed. But, destroyStrategy for them is not working properly.

Expected behaviour

I expected the previously entered data for conditional questions will be removed (which is default) for text and radios-inline types and set to be empty for the select type when form elements are disappeared from the screen.

Actual behaviour

If valid data is entered, the data is always retained (it is not removed or set to be empty). However, if invalid data is entered, this invalid data is cleaned up (removed) when the form element is removed from the screen.
For valid data, $destroy event seems to be not calling properly.

Gist/Plunker/Demo

https://plnkr.co/edit/rYuk0YmBDN3k3sTJusAy?p=preview

Related issues

This is/maybe related to ...#689

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions