Hello there,
I would like to know if it this functionality exists or if there is intention to add this functionality in future and if not, what are reasons to not to do that.
Functionality: (React, Material)
Let’s use this schema for our data:
const schema = {
type: 'object',
properties: {
flag: {
type: 'boolean',
},
myEnum: {
type: 'string',
enum: ['none','1', '2'],
default: 'none',
},
},
anyOf: [
{
if: {
properties: {
flag: {
const: true
}
}
},
then: {
properties: {
myEnum: {
type: 'string',
enum: ['none', '1', '2', '3'],
default: 'none',
},
}
}
},
]
};
UI schema is not important in this case, just casual view.
Based on this schema by default, as a user I would like to choose from dropdown one of myEnum values [‘none’,‘1’, ‘2’].
Later on, when I change flag value to true, I would like to be able to choose from myEnum values [‘none’,‘1’, ‘2’, ‘3’].
Later on, when I change flag value to false, I would like to be able to choose only from myEnum values [none, 1, 2] and my selected value would be default again.
Thank you.