Description
Is your feature request related to a problem? Please describe.
Currently it is not possible to delete a property represented by a complex renderer, i.e. one cannot delete a complete object/array from the JSON data. This is a useful feature in forms.
Describe the solution you'd like
A simple solution for this would be to include a Delete component inside every complex renderer that would set the property value to undefined
.
const deleteProperty = () => {
props.handleChange(props.path, undefined);
}
.
.
.
return (
<Delete onDelete={deleteProperty} />
// Renderer JSX code
)
Describe alternatives you've considered
The first approach seems straightforward, haven't thought of any alternatives yet.
Describe for which setup you like to have the improvement
Framework: React
RendererSet: Material, Vanilla
Additional context
I have successfully implemented this by writing a custom renderer, and hence this can be integrated into the default ones too. Let me know if the suggested implementation looks right, I'll create a PR for this then.