-
Notifications
You must be signed in to change notification settings - Fork 14
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
Error in case of using nested objects in uiSchema #44
Comments
See also #46 |
anyone know any workaround for this? I am trying to apply tabs to something like this -
I need fieldGroup1 and fieldGroup2 to be the two tabs. The following does not work
|
Same problem if you use ui:field in nested structure. // Nested NOT work
const uiSchema = {
first: {
nested: {
'ui:field': 'MyCustomField'
}
}
}
const schema = {
first: {
type: 'object',
properties: {
nested: {
type: 'object',
properties: {
pros1: {
type: 'number'
},
props2: {
type: 'number'
}
}
},
}
}
}
// Not nested work
const uiSchema = {
first: {
'ui:field': 'MyCustomField'
}
}
const schema = {
first: {
type: 'object',
properties: {
pros1: {
type: 'number'
},
props2: {
type: 'number'
}
}
}
} any updates? |
kind of the same issue over here. I'm trying to display two objects in two tabs. But the tab navigation is rendered at the wrong place: The navigation is rendered below the input title, which is obviously not the expected result. The navigation should be place below the form title "My Form!". Is there any workaround for this? FWIW: If I remove This how the wrong output looks like (code below): export const schema = {
"type": "object",
"properties": {
"thing1": {
"type": "object",
"properties": {
"input1": { "type": "string" }
}
},
"thing2": {
"type": "object",
"properties": {
"input2": { "type": "string" }
}
}
}
};
export const uiSchema = {
"ui:title": "My Form!",
"thing1": {
"nav": "main",
"ui:title": "Thing 1 Title",
"input1": {
"nav": "main"
}
},
"thing2": {
"nav": "other",
"ui:title": "Thing 2 Title",
"input2": {
"nav": "other"
}
}
}; |
I encountered the exact same issue recently. I inspected the code and located the logic in func extractTree within file extractTree.js. workaround is to set ui:order in uiSchema at initial rendering and onNavChange handler. I use a map to store nav name and the array of fields for ui:order. something like this (note: you need the star for rest of fields at the end of the array): const initNav = "main"; const uiNavOrderMap = { setUiOrder = (activeNav) => { <FormWithNavs
|
Hello. I`am trying to use schemas like this:
And got the error:
Also it could be a good idea to allow to define "nav" for object field and render all contained properties as like they are inherit "nav" from parent object field?
The text was updated successfully, but these errors were encountered: