Closed dyatko closed 1 year ago
Hi @dyatko! Such changes won't go into uniforms core packages, as this would tie a bridge (here: JSON Schema) with a theme (here: MUI, I guess). However, you can do it easily without core changes:
description
field into uniforms.helperText
(or any other).getProps
method to copy (or rename) the description
prop to helperText
(or any other).Of course, these two can be mixed and matched if needed, depending on the use case.
No response so far, so I'm closing. Feel free to comment further, though!
I just wanted to thank you, @radekmie, for your comment. It helped me a lot!
For others: In my case, I was using the uniforms-antd
and uniforms-bridge-json-schema
packages and all it took me was to extend the JSONSchemaBridge
to map the description
field to the info
prop.
I decided to patch-package uniforms-antd
because I wanted an InfoCircleOutlined
icon instead but that's beside the point a bit. Snippet:
class CustomJSONSchemaBridge extends JSONSchemaBridge {
getProps(name: string) {
const { description, ...props } = super.getProps(name);
return { ...props, info: description };
}
}
new CustomJSONSchemaBridge({...}) // Instead of new JSONSchemaBridge
We have a
version
field with the following schema generated by JSONSchemaBridge:At the moment mui
AutoForm
renders such field:While we would love to have the option to use the field description as a helper text, e.g.: