Can conditions run on individual objects in an array?
Closed this issue · 3 comments
mrclay commented
We have an array of objects, and need conditions to apply based on fields in the same array element. Something like:
{
conditions: {
'arr[x].foo': { equal: true }},
},
event: {
type: 'remove',
params: { field: 'arr[x].bar' }
}
};
mrclay commented
I think we'll have to process rules separately for each object in formData. We're already using a separate Form element to handle conditionals within the array object.
mavarazy commented
@mrclay for internal selection selectn library is used, so as long is you have a specific index in the array, there is no problem with rulesEngine, but I suspect there will be a problem with react-jsonschema-form-conditionals project, I'll check. Refer to the test that I submitted.
mavarazy commented
Here is a test for removing element from an array in conditionals project
RXNT/react-jsonschema-form-conditionals@4667979