-
Notifications
You must be signed in to change notification settings - Fork 649
DestroyStrategy option is not working properly #703
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
Comments
For your information, here is version information which I am using in Plunker. |
@warmy1004 thanks for the additional info, once the webpack/babel branch is stabilised we will be able to look at this. |
I want to share with you what I found for this issue. |
@warmy1004 thanks for the info, I appreciate your follow up, once the webpack/babel branch is merged to dev, hopefully someone can do a PR to correct the behaviour or add a test case for me to fix against. |
@warmy1004 how does this one look on the latest dist folder files in dev branch? Are you able to confirm it is working again after all the changes I made to fix destroy behaviour? |
@Anthropic I retested it and this is fixed in the alpha 4 version. Thank you. |
Woo hoooo! |
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
The text was updated successfully, but these errors were encountered: