react-jsonschema-form icon indicating copy to clipboard operation
react-jsonschema-form copied to clipboard

enableMarkdownInDescription does not work in parent elements of if description is above input element

Open quazgar opened this issue 2 years ago • 4 comments

Prerequisites

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:

  1. Add "ui:enableMarkdownInDescription": true to the ui schema definition in an element which has children.
  2. Add a description which should be rendered as Markdown.

Environment

Current playground.

Anything else?

No response

quazgar avatar Nov 27 '23 14:11 quazgar

@dejanbelusic @heath-freenome ping, because you seem to have been involved in #3665

quazgar avatar Nov 29 '23 10:11 quazgar

@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?

heath-freenome avatar Dec 01 '23 20:12 heath-freenome

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.

quazgar avatar Dec 05 '23 23:12 quazgar

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
}}}

quazgar avatar Dec 07 '23 13:12 quazgar