-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Default checkbox field ignores ui:title and ui:description #827
Comments
Reproducible JSFiddle: https://jsfiddle.net/epicfaace/xh0uyLjn/ |
This should not be hard to fix, I did encounter the same issue. |
@CauchyAbel it's labeled "good first issue" for a reason -- would you like to fix it? 😉 |
I would fix it during free time since I know this is a long live issue and not that critical, LOL I did come across this myself so I knew :) Assign to me if you could :) |
this issue seems to be default behavior for rjsf default boolean field In SchemaField.js: L273 - L275
I believe adding "ui:widget":"checkbox" to uiSchema solves this issue. |
Building on the answer that @cbuv wrote, I believe that just adding "ui:widget":"checkbox" to uiSchema wouldn't be enough to solve the issue. However, something along the lines of the following might help us.
Notice that instead of |
Im facing this problem. Is it solved yet? Any workaround? |
Wow, still an issue in 5.x, but it differs across the various themes. See this playground |
…layed correctly Fixes rjsf-team#827, rjsf-team#2636, rjsf-team#2399, rjsf-team#2791, rjsf-team#3231, and rjsf-team#3531 so that titles, descriptions and labels are picked up from uiSchema then schema and are hidden correctly when `label` in uiSchema is false - Updated `@rjsf/utils` to add `displayLabel` to `WidgetProps` - Updated `@rjsf/core` to fix the bugs as follows: - Updated `ArrayField`, `MultiSchemaField`, `StringField` to pass the label as `uiOptions.title || schema.title || name` as well as passing `displayLabel` from the `uiOptions` - Updated `ObjectField` to not pass `title` or `description` when `displayLabel` is false and `ObjectTitleTemplate` to only check `title` and `description` - Updated `ArrayFieldDescriptionTemplate` and `ArrayFieldTitleTemplate` to pass `globalUiOptions` into `getUiOptions` to pick up the global `label` - Updated `CheckboxWidget` to not show description when `displayLabel` is false - Updated `@rjsf/antd` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `@rjsf/bootstrap-4` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `RangeWidget` to only pass `label` in the `extraProps` when `displayLabel` is true - Updated `@rjsf/chakra-ui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget`, `TextareaWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated test snapshots due to fixed bugs - Updated `@rjsf/fluent-ui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `ColorWidget`, `DateWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated `FieldTemplate` to hide description when `displayLabel` is false - Updated test snapshots due to fixed bugs - Updated `@rjsf/material-ui` and `@rjsf/mui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget` and `SelectWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated test snapshots due to fixed bugs - Updated `@rjsf/semantic-ui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `SelectWidget` and `TextareaWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated test snapshots due to fixed bugs - Updated the `widget` documentation for the new `displayLabel` prop - Updated the `CHANGELOG.md` file accordingly
…layed correctly Fixes rjsf-team#827, rjsf-team#2636, rjsf-team#2399, rjsf-team#2791, rjsf-team#3231, and rjsf-team#3531 so that titles, descriptions and labels are picked up from uiSchema then schema and are hidden correctly when `label` in uiSchema is false - Updated `@rjsf/utils` to add `displayLabel` to `WidgetProps` - Updated `@rjsf/core` to fix the bugs as follows: - Updated `ArrayField`, `MultiSchemaField`, `StringField` to pass the label as `uiOptions.title || schema.title || name` as well as passing `displayLabel` from the `uiOptions` - Updated `ObjectField` to not pass `title` or `description` when `displayLabel` is false and `ObjectTitleTemplate` to only check `title` and `description` - Updated `ArrayFieldDescriptionTemplate` and `ArrayFieldTitleTemplate` to pass `globalUiOptions` into `getUiOptions` to pick up the global `label` - Updated `CheckboxWidget` to not show description when `displayLabel` is false - Updated `@rjsf/antd` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `@rjsf/bootstrap-4` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `RangeWidget` to only pass `label` in the `extraProps` when `displayLabel` is true - Updated `@rjsf/chakra-ui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget`, `TextareaWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated test snapshots due to fixed bugs - Updated `@rjsf/fluent-ui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `ColorWidget`, `DateWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated `FieldTemplate` to hide description when `displayLabel` is false - Updated test snapshots due to fixed bugs - Updated `@rjsf/material-ui` and `@rjsf/mui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget` and `SelectWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated test snapshots due to fixed bugs - Updated `@rjsf/semantic-ui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `SelectWidget` and `TextareaWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated test snapshots due to fixed bugs - Updated the `widget` documentation for the new `displayLabel` prop - Updated the `CHANGELOG.md` file accordingly
…layed correctly Fixes rjsf-team#827, rjsf-team#2636, rjsf-team#2399, rjsf-team#2791, rjsf-team#3231, and rjsf-team#3531 so that titles, descriptions and labels are picked up from uiSchema then schema and are hidden correctly when `label` in uiSchema is false - Updated `@rjsf/utils` to add `displayLabel` to `WidgetProps` - Updated `@rjsf/core` to fix the bugs as follows: - Updated `ArrayField`, `MultiSchemaField`, `StringField` to pass the label as `uiOptions.title || schema.title || name` as well as passing `displayLabel` from the `uiOptions` - Updated `ObjectField` to not pass `title` or `description` when `displayLabel` is false and `ObjectTitleTemplate` to only check `title` and `description` - Updated `ArrayFieldDescriptionTemplate` and `ArrayFieldTitleTemplate` to pass `globalUiOptions` into `getUiOptions` to pick up the global `label` - Updated `CheckboxWidget` to not show description when `displayLabel` is false - Updated `@rjsf/antd` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `@rjsf/bootstrap-4` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `RangeWidget` to only pass `label` in the `extraProps` when `displayLabel` is true - Updated `@rjsf/chakra-ui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget`, `TextareaWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated test snapshots due to fixed bugs - Updated `@rjsf/fluent-ui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `ColorWidget`, `DateWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated `FieldTemplate` to hide description when `displayLabel` is false - Updated test snapshots due to fixed bugs - Updated `@rjsf/material-ui` and `@rjsf/mui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget` and `SelectWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated test snapshots due to fixed bugs - Updated `@rjsf/semantic-ui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `SelectWidget` and `TextareaWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated test snapshots due to fixed bugs - Updated the `widget` documentation for the new `displayLabel` prop - Updated the `CHANGELOG.md` file accordingly
…layed correctly (#3533) * fix: many bugs related to titles, descriptions, labels not being displayed correctly Fixes #827, #2636, #2399, #2791, #3231, and #3531 so that titles, descriptions and labels are picked up from uiSchema then schema and are hidden correctly when `label` in uiSchema is false - Updated `@rjsf/utils` to add `displayLabel` to `WidgetProps` - Updated `@rjsf/core` to fix the bugs as follows: - Updated `ArrayField`, `MultiSchemaField`, `StringField` to pass the label as `uiOptions.title || schema.title || name` as well as passing `displayLabel` from the `uiOptions` - Updated `ObjectField` to not pass `title` or `description` when `displayLabel` is false and `ObjectTitleTemplate` to only check `title` and `description` - Updated `ArrayFieldDescriptionTemplate` and `ArrayFieldTitleTemplate` to pass `globalUiOptions` into `getUiOptions` to pick up the global `label` - Updated `CheckboxWidget` to not show description when `displayLabel` is false - Updated `@rjsf/antd` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `@rjsf/bootstrap-4` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `RangeWidget` to only pass `label` in the `extraProps` when `displayLabel` is true - Updated `@rjsf/chakra-ui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget`, `TextareaWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated test snapshots due to fixed bugs - Updated `@rjsf/fluent-ui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `ColorWidget`, `DateWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated `FieldTemplate` to hide description when `displayLabel` is false - Updated test snapshots due to fixed bugs - Updated `@rjsf/material-ui` and `@rjsf/mui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget` and `SelectWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated test snapshots due to fixed bugs - Updated `@rjsf/semantic-ui` to fix the bugs as follows: - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false - Updated `BaseInputTemplate`, `CheckboxesWidget`, `SelectWidget` and `TextareaWidget` to hide `label` when `displayLabel` and `label` are falsy - Updated test snapshots due to fixed bugs - Updated the `widget` documentation for the new `displayLabel` prop - Updated the `CHANGELOG.md` file accordingly * - Added a new `labelValue()` function to `@rjsf/utils` - Updated all ui packages to use `labelValue()` as appropriate, in some cases replacing the `schema.title` with `undefined` which is the real value of `schema.title` when label is an empty string - Added a new `FluentLabel` component by refactoring common code out of `CheckboxesWidget`, `ColorWidget`, `RangeWidget` and `UpDownWidget` * - Missed one `labelValue()` usage * Apply suggestions from code review Fix bug links
Prerequisites
Description
The default checkbox field for boolean forms does not respect the
ui:title
orui:description
fields making it difficult to overwrite.Steps to Reproduce
Given a schema of:
And a UI Schema of:
Behavior
The form only displays the title from the description.
Expected behavior
It should display the
ui:title
and theui:description
as well.Given a schema of:
And a UI Schema of:
Behavior
The form only displays the the title, the description, the ui title, the ui description and the title.
Expected behavior
It should display only the
ui:title
and theui:description
.Version
1.0.0
The text was updated successfully, but these errors were encountered: