Skip to content

[bootstrap-4] Widget and FieldTemplate customisation #2007

@stufisher

Description

@stufisher

Prerequisites

Description

The boostrap-4 theme widgets now wrap each form control in a Form.Group directly with the label:
https://github.com/rjsf-team/react-jsonschema-form/blob/master/packages/bootstrap-4/src/TextWidget/TextWidget.tsx

this makes it pretty difficult to customise the form layout by providing a custom FieldTemplate. The only way to do this is to now copy and paste each widget you need and modify them independently.

Previously you could inject a customised FieldTemplate and thus override the label / field positioning as the label was part of the FieldTemplate and not the specific Widget in question

Steps to Reproduce

Expected behavior

It would be better for customisation if the label was injected from the FieldTemplate rather than in each widget (as this worked previously)

Actual behavior

You have to modify every Widget class rather than the FieldTemplate

Version

@rjsf/bootstrap-4: ^2.3.0
@rjsf/core: ^2.1.0

Metadata

Metadata

Assignees

Labels

buglabelOrDescriptionRelating to labels and descriptions of fields in the formreact-bootstrapreact-bootstrap related theme issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions