React-jsonschema-form: Bootstrap 4 theme not applying UiSchema classNames

Created on 18 Aug 2020  Â·  5Comments  Â·  Source: rjsf-team/react-jsonschema-form

Prerequisites

  • [ ✔ ] I have read the documentation;
  • [ ✔ ] In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
  • [ ✔ ] I'm providing a shared playground link demonstrating the issue.

Steps to Reproduce

  1. As an example, add a "classNames" property in the uiSchema to any of the form fields ("firstName" in the playground link) and set it to "bg-danger (FYI I'm currently using col-* classes with the Bootstrap 3 theme and it works as expected in my project)
  2. Load the form in a browser

Expected behavior

I would expect to see a "danger color" around the input (i.e. red)

Actual behavior

No background color. The class is not applied anywhere in the DOM. Here's a screenshot comparing the two versions. BS3 in the middle, BS4 on the right.

bs3_v_bs4_comparison

Version

Here's what's in my package.json (though my repro steps use the playground)
"@rjsf/bootstrap-4": "^2.3.0",
"@rjsf/core": "^2.3.0",

bootstrap-4

Most helpful comment

I would like to add more to the issue, neither of these uiSchema options seems to work as they should:

They don't do their changes at all

  • ui:title
  • ui:placeholder
  • ui:options

    • label: false

      It doesn't appear as expected

  • ui:description

    • Appeas under the input field, just like a ui:help

I attach a playground link to demonstrate this additional issues

All 5 comments

@anikethsaha @Xtremilicious. Tagging you as I know this was your project.

I would like to add more to the issue, neither of these uiSchema options seems to work as they should:

They don't do their changes at all

  • ui:title
  • ui:placeholder
  • ui:options

    • label: false

      It doesn't appear as expected

  • ui:description

    • Appeas under the input field, just like a ui:help

I attach a playground link to demonstrate this additional issues

Echoing that adding classNames in uiSchema is not adding classes to components. Any updates on when this might be added?

Would like to add even more here: in bootstrap-4 no classes at all exist there apart from bootstrap styling (row, py-*, my-* etc, obviously going with !important directive) + direct style attribute; which is absolutely annoying making this almost impossible for even slight adjustments (comparing to default bootstrap-3).

Screenshot 2021-01-21 at 15 17 20

so WAS hoping that uiSchema could help here, but not

If anyone is willing to make a PR to fix this issue, we'd gladly accept it!

Was this page helpful?
0 / 5 - 0 ratings