FIO-9159: change clearOnHide behavior to track conditionally hidden state rather than mere visibility #5902
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to Jira Ticket
https://formio.atlassian.net/browse/FIO-9159
Description
This commit changes the behavior of the clearOnHide property. Previously, when this flag was present in a component, the renderer would unset the component's value from submission data if it was not visible (so, conditionally hidden, logically hidden, or intentionally hidden via the hidden property). Now, clearOnHide will only unset the component's data if it or its parent is conditionally or logically hidden. The copy of the parameter in the builder has also been changed.
Breaking Changes / Backwards Compatibility
This constitutes a breaking change. The clearOnHide property no longer functions the way that it used to. A component with
clearOnHide
enabled will "clear" the component's value if the component or its parent is conditionally hidden.Dependencies
@formio/core#173
How has this PR been tested?
Manual + automated tests
Checklist: