react-jsonschema-form
react-jsonschema-form copied to clipboard
enableMarkdownInDescription does not work in parent elements of if description is above input element
Prerequisites
- [X] I have searched the existing issues
- [X] I understand that providing a SSCCE example is tremendously useful to the maintainers.
- [X] I have read the documentation
- [X] Ideally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
What theme are you using?
material-ui
Version
5.x / current playground
Current Behavior
As demonstrated in this playground instance, enableMarkdownInDescription only seems to work in leaf nodes, not in higher levels of the json schema tree.
Expected Behavior
enableMarkdownInDescription should work everywhere.
Steps To Reproduce
Option 1: Look ath the playground example linked above.
Option 2:
- Add
"ui:enableMarkdownInDescription": trueto the ui schema definition in an element which has children. - Add a description which should be rendered as Markdown.
Environment
Current playground.
Anything else?
No response
@dejanbelusic @heath-freenome ping, because you seem to have been involved in #3665
@quazgar Good catch. I'm really busy and I do not have time to make a fix. If @dejanbelusic is unable to help, would you be willing to provide a PR to fix this?
I am pretty busy myself, but maybe I can find a customer who needs this and is willing to pay, or a colleague might find the time.
New playground instance which shows that markdown also does not seem to work for descriptions which render above the input element (a boolean field in this case).
Schema
{
"title": "A list of tasks",
"type": "object",
"properties": {
"tasks": {
"description": "*very* simple, but no Markdown",
"type": "object",
"title": "Tasks",
"properties": {
"details": {
"type": "string",
"title": "Task details",
"description": "Description which renders Markdown *correctly*."
},
"has_Markdown": {
"type": "boolean",
"description": "Also *no Markdown*"
}}}}}
UI schema
{
"tasks": {
"ui:enableMarkdownInDescription": true,
"ui:description": "New *description*, still no Markdown.",
"details": {
"ui:enableMarkdownInDescription": true,
"ui:widget": "textarea"
},
"has_markdown": {
"ui:enableMarkdownInDescription": true
}}}