react-json-editor
react-json-editor copied to clipboard
referencing property changes
I have a requirement that the value of the field depends on the value of another field. eg.
schema = {
title : "My pretty form",
description: "Declarative pure data DSLs are the best.",
type : "object",
properties : {
comments: {
title : "Your comment",
description: "Type something here.",
type : "string",
minLength : 1
},
anotherField: {
title : "autocomplete",
references: ['comment'] // new property
description: "auto",
'x-hints': {
'form': {
'inputComponent': 'async-autocomplete'
}
}
}
}
};
Now i added references something new to the above schema. My requirement is that this custom component can have a listener that can listen to any changes to the fields mentioned in references, in above case any change made to comments field should trigger a listener in anotherField. Can someone help me with this?