Hidden radio component still shows when conditional is present
Environment
Please provide as many details as you can: A radio component marked as hidden still shows when there is a conditional present. When the conditional is removed, it properly hides the component.
We use an archive process where we simply mark a given component as hidden when we change things around in our forms, but want to maintain a reference to what was there in a previous iteration. Would prefer to keep the conditionals as well for reference and have it honor the hidden checkbox when checked despite having a conditional applied.
- Hosting type
- [] Form.io
- [ x ] Local deployment
- Version:
- Formio.js version: 4.10.2
- Frontend framework: Bootstrap 3
- Browser: Chrome
- Browser version: newest
Steps to Reproduce
- Create a radio component with yes and no as data points.
- Add a conditional
- Mark it as hidden
Expected behavior
The component should not show in the form due to the hidden checkbox
Observed behavior
The component will ignore the hidden checkbox when the conditional is present and will still show in the form.
Example
If possible, please provide a screenshot, live example (via JSFiddle or similar), and/or example code to help demonstrate the issue.
For code or form JSON, please enclose in a code block:
// your code here
I believe this is expected since "conditions" on the component take priority over the hidden checkbox. To achieve what you are looking for, just add a custom CSS class to the component, and then in CSS provide "display: none"
It appears to ignore other things like the validation checkbox as well, so in our case a CSS class won't help. I do appreciate the recommendation though.
It was my understanding that the hidden checkbox would overrule other items and simply remove it completely from the flow of the form.
Hidden does not override all conditional logic, it is just the default state of the component. If a conditional evaluates to show a component, it will show. If you never want a component to show, mark it as hidden and don't add any conditional logic.
Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!