-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested dynamic schema dependencies #1217
Comments
@kalyan542 Can you please post a playground link (https://mozilla-services.github.io/react-jsonschema-form) demonstrating the issue? That will help us get to the problem faster. |
Please see this below example. |
Added jsfiddle playground link |
@kalyan542 What are you expecting? When I select "CMC" I get the following fields, which seems to accord with what the schema describes: |
Select option1 in select box A show all the fields B,Name,Age,Id,Enable --> this case is working as expected,Struggling with below cases. only show name and age fields If i select CMC in Select box B |
@kalyan542 Does this schema work for you? https://jsfiddle.net/jhocLqvb/ |
B select box has to show after A select box. if i add uiSchema={uiSchema} for fields order getting this error "Invalid root object field configuration:uiSchema order list contains extraneous property 'B'." |
That error should not come in the latest playground version, since #814 was merged: Playground link. However, this fix has not been released in the latest version yet. However, there seems to be another problem -- the ui:order is not being respected, probably because of something related to nested dependencies. |
This issue seems too old. ` ` |
Per @ezzadeen this seems to be fixed. Please open a new issue if any related issues persist. |
I have select box A which has options option1, option2
if select option1 in select box A, populate another select box B with options NORMAL, CMC
If i select Normal in select box B, populate some fields name, age
If select CMC populate fields id, enable
I can able to populate dependency fields based on select box A but not with select box B.
{
type: "object",
properties: {
A: {
"title": A,
"type": "string",
"enum": [
"--select--",
"option1",
"option2",
],
"default": "--select--"
},
},
"dependencies": {
"A": {
"oneOf": [
{
"properties": {
A: {
"enum": [
"option1"
]
},
B: {
type: "string",
title: B,
enum: [
"NORMAL",
"CMC"
],
enumNames: [
"NORMAL",
"CMC"
]
},
name: {
type: "string",
title: "name"
},
age: {
type: "string",
title: "age"
},
}
},
]
}
}
}
The text was updated successfully, but these errors were encountered: