Sam Tomaka
Sam Tomaka

Reputation: 23

Formio: Set Clear Value When Hidden to "false" by default?

I need to modify our formio framework so that the "Clear Value When Hidden" form component setting is "false" (unchecked) by default. I couldn't find any comprehensive documentation on modifying Formio defaults, and the only solutions I've come up with either don't uncheck the box or remove the property entirely, which causes catastrophic issues.

It would be difficult to illustrate this issue with code snippets due to the formatting of said code. But hopefully this catches the eye of someone familiar with the Formio framework who might be able to lend some insight.

In summary, "Uncheck Clear Value When Hidden" is a form component setting. Since Formio renders page content via JSON representations of the forms we create, this setting is represented in the JSON as the "clearOnHide" prop. "clearOnHide" is defaulted by the Formio framework to "true" for most/all components (so when you add a new component, you'll see "Clear Value When Hidden" checked in the settings box). All we want to do is change that default, but regardless the prop has to exist in the JSON for each component, otherwise it will not render correctly.

Upvotes: 0

Views: 156

Answers (0)

Related Questions