Closed cmorcom closed 4 months ago
It seems you are just changing the JSON of the component and not re-rendering the form after it has been collapsed. Instead to force the component to be collapsed, you will need to get the Panel component and then call the "collapsed" property on the actual component instance and not the JSON.
export class FormRenderComponent {
@ViewChild(FormioComponent) formioComponent: FormioComponent;
function collapseSection() {
const component = this.formioComponent.formio.getComponent('mypanel');
if (data && data.example && data.example < 16) {
component.collapsed = true;
}
else {
component.collapsed = false;
}
}
}
Environment
Steps to Reproduce
Expected behavior
If condition is met, it's expected that the panel will be collapsed.
Observed behavior
The panel does not collapse, even if the condition is met.
collapsed is being set to true (as seen in console), but this is not reflected visually.
Example
Custom code:
Console: