Closed
Description
Scope: PF4 mapper
Description
When using a condition to hide an input from within a form-array the label will remain while the input get's hidden. This is due to the fact that the label is handled outside of the rendering of the input. I'm placing this here in case others might have an approach to resolving this (I can't see a clear path).
The only approach I can see would be to do an application of the conditions before a render call, perhaps something like a preRender()
.
Schema
const schema = {
fields: [
{
"component": "field-array",
"label": "Select One",
"name": "SelectOne",
"fields": [
{
"component": "select",
"label": "Select Option",
"name": "Option",
"simpleValue": true,
"options": [
{
"label": "Placeholder1",
"value": "Placeholder1"
},
{
"label": "Placeholder2",
"value": "Placeholder2"
},
]
},
{
"component": "text-field",
"name": "HiddenInput",
"label": "Hidden Input",
"condition": {
when: `Option`,
is: 'Placeholder1',
then: {visible: true},
}
},
]
}
]
}