-
Notifications
You must be signed in to change notification settings - Fork 649
destroyStrategy isn't followed when a field is removed from DOM. #508
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
Ohhh... interesting! Thanks for testing the new builder. I'll check it out. In the new builder the |
Okay, thanks for the follow-up. It sounds like the sf-field directive is what we talked about in #371. Is that for the new builder only? My quick perusal through the code seemed to indicate that was a possibility. |
@jbsaff No its not quite what we talked about in #371. But you are right it's for the new builder. The |
Okay, sounds like a reasonable spot to put the functionality, and looks really nice with the new builder. Found the primary problem with checkboxes in the new builder: Condition isn't in the dependency list, so it's never checked for the checkboxes type. It looks like it was removed in commit e24d164534e4d6d872e14b0e6f5d9a1b37541dfc. I've added line comments in a couple places in each project related to this issue. |
Ok, so I did a small release of ASF and one of the new bootstrap decorator with the condition in the list of builders. Thanks for the help @jbsaff! |
http://schemaform.io/examples/bootstrap-example.html#/976bfc96771600614451
Toggle the checkbox, and the condition-limited field remains in the model.
Without the new builder:
If the condition is applied to a container (such as the deprecated "conditional" type, or a field set), then the fields are cleaned up following the appropriate destroyStrategy. But fields that have a condition applied directly as a form option have the $destroy listener set on the bootstrap-decorator wrapper tag, which is never actually removed from the DOM by conditions.
With the new builder:
I'm seeing some fields work as expected (triggering to show a text field when a certain value in a drop down list is selected), but checkbox list fields don't appear to be following the condition behavior. I'll need to dig into this more for 0.8.5+ development.
The text was updated successfully, but these errors were encountered: