-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
Prerequisites
- I have read the documentation
What theme are you using?
mui
What is your question?
Hello,
Is it possible to override a value of dynamically shown field if a condition is met?
I was trying this example.
I want to have one conditional field and change it's value if another field is checked or not. Is that possible to do inside a schema?
{
"title": "Conditional Field Example",
"type": "object",
"properties": {
"includeField": {
"type": "boolean",
"title": "Include additional field?"
},
"additionalField": {
"type": "string",
"title": "Additional Field"
}
},
"dependencies": {
"includeField": {
"oneOf": [
{
"properties": {
"includeField": {
"const": true
},
"additionalField": {
"type": "string",
"title": "Additional Field2",
"default": "test 2"
}
}
},
{
"properties": {
"includeField": {
"const": false
},
"additionalField": {
"type": "string",
"title": "Additional Field3",
"default": "test 3"
}
}
}
]
}
}
}