FIO-9159: add intentionallyHidden ephemeral state and change clearOnHide behavior #172
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
The platform has always treated an intentionally hidden component (i.e. one with the
hidden
property checked) as the same as conditionally hidden. This, combined with the fact that theclearOnHide
property defaults totrue
, means that the the server would likely clear any intentionally hidden container's (e.g. Container component, Edit Grid, Nested Form, etc.) data. For a long while, however, there was a bug that meant that Nested Forms would not behave this way.This PR aims to simplify and codify the behavior of hidden components - the
clearOnHide
property will now clear data only when that component is conditionally hidden. Intentionally hidden components will be unaffected and their data will not be cleared.Breaking Changes / Backwards Compatibility
This fundamentally is a breaking change, because it decouples intentionally hidden components from conditionally hidden ones. It needs to be included in a changelog as breaking and released as part of a major version.
Dependencies
n/a
How has this PR been tested?
Added automated tests around clearOnHide
Checklist: