Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override field DescriptionField #2219

Closed
2 tasks done
gaitat opened this issue Feb 3, 2021 · 5 comments
Closed
2 tasks done

Override field DescriptionField #2219

gaitat opened this issue Feb 3, 2021 · 5 comments
Labels
bootstrap-4 bootstrap-4 related theme issue bug help wanted material-ui material-ui related theme issue

Comments

@gaitat
Copy link

gaitat commented Feb 3, 2021

Prerequisites

Description

When I override DescriptionField in core then all works fine. When I override it in material-ui or bootstrap-4 then nothing happens.

Steps to Reproduce

  1. Go to above sample (core is enabled) and observe that all is fine.
  2. Comment lines 27-29 and observe that the description on the schema element disappears. So far so good.
  3. Change import Form from "@rjsf/core"; to import Form from "@rjsf/material-ui"; or import Form from "@rjsf/bootstrap-4";
  4. No matter if lines 27-29 are commented out or not, the description field gets rendered.

Expected behavior

When I override DescriptionField in material-ui or bootstrap-4 and comment out lines 27-29 I expect not to see the description field being rendered.

Actual behavior

The description field is still rendered when material-ui or bootstrap-4 is selected and lines 27-29 are commented out.

What am I doing wrong?

@epicfaace epicfaace added the bug label Feb 3, 2021
@JonSilver
Copy link

I can confirm that a custom DescriptionField supplied to the Form component in the fields prop is ignored and unused in the Bootstrap-4 variant.

@aucuparia
Copy link

aucuparia commented Apr 22, 2021

I don't have a solution, but noticed that it does work when the type is object instead of string. I can reproduce this in @gaitat's sample by adding description: "test", to the "custom fields demo" object and then commenting lines 27-29. This hides the description.

@epicfaace epicfaace added material-ui material-ui related theme issue bootstrap-4 bootstrap-4 related theme issue help wanted labels Apr 24, 2021
@JonSilver
Copy link

Duplicate of #2363

@ssbyoung
Copy link

For semantic-ui I've fixed this issue in the following PR: #2451

Bootstrap and material UI are doing the same thing where they aren't getting the description component from the registry.

alex-pex added a commit to alex-pex/react-jsonschema-form that referenced this issue Oct 28, 2021
alex-pex added a commit to alex-pex/react-jsonschema-form that referenced this issue May 11, 2022
alex-pex added a commit to alex-pex/react-jsonschema-form that referenced this issue May 11, 2022
alex-pex added a commit to alex-pex/react-jsonschema-form that referenced this issue May 16, 2022
alex-pex added a commit to alex-pex/react-jsonschema-form that referenced this issue Jun 10, 2022
@heath-freenome
Copy link
Member

Fixed in the v5 beta, see the 5.x migration guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bootstrap-4 bootstrap-4 related theme issue bug help wanted material-ui material-ui related theme issue
Projects
None yet
Development

No branches or pull requests

6 participants