-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Description
Prerequisites
- I have read the documentation;
- In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
- Ideally, I'm providing a sample JSFiddle or a shared playground link demonstrating the issue.
Description
Hi folks, I didn't find ability to setup formData for multiple field. As I understand there is only ability to set current field. I would like to change formData with additional function which will take newFormData and path where I need to change data.
For example, I have object with fields:
{
symptom: {
title: "Condition",
type: "object",
required: [:id, :name],
properties: {
id: {
type: "number",
title: 'id'
},
name: {
type: "string",
title: 'name'
}
}
}
}
And I've created my own widget, with will render select where I choose symptom, but value already includes id and name and I would like update symptom
key with data { id: 1, name: 'Name' }
const SymptomWidget = props => {
const onChangeSymptom = symptom => {
const parsedSymptom = symptom ? JSON.parse(symptom) : null
const id = pathOr('', ['0'], parsedSymptom)
const name = pathOr('', ['1'], parsedSymptom)
props.onChange({ id, name })
}
return <ConditionSelect onChange={onChangeSymptom} />
}
But I get this result: { symptom: id: { id: 1, name: 'Name' } }
.
Version
2.4