diff --git a/CHANGELOG.md b/CHANGELOG.md index 64ae2caef5..af5256bd2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,42 @@ it according to semantic versioning. For example, if your PR adds a breaking cha should change the heading of the (upcoming) version to include a major version bump. --> +# 5.0.0 + +## @rjsf/antd +- Updated `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use indexes as values to support `enumOptions` with object values, fixing [#1494](https://github.com/rjsf-team/react-jsonschema-form/issues/1494) + +## @rjsf/bootstrap-4 +- Updated `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use indexes as values to support `enumOptions` with object values, fixing [#1494](https://github.com/rjsf-team/react-jsonschema-form/issues/1494) + +## @rjsf/chakra-ui +- Updated `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use indexes as values to support `enumOptions` with object values, fixing [#1494](https://github.com/rjsf-team/react-jsonschema-form/issues/1494) + +## @rjsf/core +- Updated `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use indexes as values to support `enumOptions` with object values, fixing [#1494](https://github.com/rjsf-team/react-jsonschema-form/issues/1494) + +## @rjsf/fluent-ui +- Updated `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use indexes as values to support `enumOptions` with object values, fixing [#1494](https://github.com/rjsf-team/react-jsonschema-form/issues/1494) + +## @rjsf/material-ui +- Updated `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use indexes as values to support `enumOptions` with object values, fixing [#1494](https://github.com/rjsf-team/react-jsonschema-form/issues/1494) + +## @rjsf/mui +- Updated `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use indexes as values to support `enumOptions` with object values, fixing [#1494](https://github.com/rjsf-team/react-jsonschema-form/issues/1494) + +## @rjsf/semantic-ui +- Updated `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use indexes as values to support `enumOptions` with object values, fixing [#1494](https://github.com/rjsf-team/react-jsonschema-form/issues/1494) + +## @rjsf/utils +- Added `enumOptionsIndexForValue()`, `enumOptionsIsSelected()`, `enumOptionsValueForIndex()` functions to support fixing [#1494](https://github.com/rjsf-team/react-jsonschema-form/issues/1494) + - Updated `enumOptionsDeselectValue()` and `enumOptionsSelectValue()` to use indexes instead of values + - Deleted the `processSelectValue()` that was added in the beta and is no longer needed + +## Dev / docs / playground +- Updated the `utility-functions` documentation for the new and updated methods mentioned above, as well as deleting the documentation for `processSelectValue()` +- Updated the playground to add a new `Enum Objects` example to highlight the use of indexes for `enumOptions` +- Updated `5.x migration guide` to document the change from values to indexes for the `enumOptions` based controls. + # 5.0.0-beta.20 ## @rjsf/antd diff --git a/docs/5.x upgrade guide.md b/docs/5.x upgrade guide.md index 115123ac92..0f1a611654 100644 --- a/docs/5.x upgrade guide.md +++ b/docs/5.x upgrade guide.md @@ -27,7 +27,7 @@ Unfortunately, there is required work pending to properly support React 18, so u There are four new packages added in RJSF version 5: - `@rjsf/utils`: All of the [utility functions](https://react-jsonschema-form.readthedocs.io/en/stable/api-reference/utiltity-functions) previously imported from `@rjsf/core/utils` as well as the Typescript types for RJSF version 5. - - The following new utility functions were added: `ariaDescribedByIds()`, `createSchemaUtils()`, `descriptionId()`, `enumOptionsDeselectValue()`, `enumOptionsSelectValue()`, `errorId()`, `examplesId()`, `getClosestMatchingOption()`, `getFirstMatchingOption()`, `getInputProps()`, `helpId()`, `mergeValidationData()`, `optionId()`, `processSelectValue()`, `sanitizeDataForNewSchema()` and `titleId()` + - The following new utility functions were added: `ariaDescribedByIds()`, `createSchemaUtils()`, `descriptionId()`, `enumOptionsDeselectValue()`, `enumOptionsIndexForValue()`, `enumOptionsIsSelected()`, `enumOptionsSelectValue()`, `enumOptionsValueForIndex()`, `errorId()`, `examplesId()`, `getClosestMatchingOption()`, `getFirstMatchingOption()`, `getInputProps()`, `helpId()`, `mergeValidationData()`, `optionId()`, `sanitizeDataForNewSchema()` and `titleId()` - `@rjsf/validator-ajv6`: The [ajv](https://github.com/ajv-validator/ajv)-v6-based validator refactored out of `@rjsf/core@4.x`, that implements the `ValidatorType` interface defined in `@rjsf/utils`. - `@rjsf/validator-ajv8`: The [ajv](https://github.com/ajv-validator/ajv)-v8-based validator that is an upgrade of the `@rjsf/validator-ajv6`, that implements the `ValidatorType` interface defined in `@rjsf/utils`. See the ajv 6 to 8 [migration guide](https://ajv.js.org/v6-to-v8-migration.html) for more information. - `@rjsf/mui`: Previously `@rjsf/material-ui/v5`, now provided as its own theme. @@ -38,6 +38,13 @@ In many of the themes the `id`s for the `Title`, `Description` and `Examples` bl In addition, some of the `id`s for various input values were updated to be consistent across themes or to fix small bugs. For instance, the values for radio buttons in the `RadioWidget` and checkboxes in the `CheckboxesWidget` are of the form `xxx-${option.value}`, where `xxx` is the id of the field. +### `enumOptions[]` widgets BREAKING CHANGES + +There are examples of schemas where `enumOptions[]` values are objects rather than primitive types. +In every theme, the `enumOptions[]` rendering widgets `CheckboxesWidget`, `RadioWidget` and `SelectWidget` previously used the `enumOptions[].value` to as the value used for the underlying `checkbox`, `radio` and `select.option` elements. +Now, these `CheckboxesWidget`, `RadioWidget` and `SelectWidget` components use the index of the `enumOptions[]` in the list as the value for the underlying elements. +If you need to build a custom widget for this kind of `enumOptions`, there are a set of `enumOptionsXXX` functions in `@rjsf/utils` to support your implementation. + ### `@rjsf/core` BREAKING CHANGES #### Types diff --git a/docs/api-reference/utility-functions.md b/docs/api-reference/utility-functions.md index 3891844ecb..056b15d7ea 100644 --- a/docs/api-reference/utility-functions.md +++ b/docs/api-reference/utility-functions.md @@ -96,26 +96,65 @@ Return a consistent `id` for the field description element. - string: The consistent id for the field description element from the given `id` ### enumOptionsDeselectValue\() -Removes the `value` from the currently `selected` list of values. +Removes the enum option value at the `valueIndex` from the currently `selected` (list of) value(s). +If `selected` is a list, then that list is updated to remove the enum option value with the `valueIndex` in `allEnumOptions`. +If it is a single value, then if the enum option value with the `valueIndex` in `allEnumOptions` matches `selected`, undefined is returned, otherwise the `selected` value is returned. #### Parameters -- value: EnumOptionsType\["value"] - The value that should be selected -- selected: EnumOptionsType\["value"][] - The current list of selected values +- valueIndex: string | number - The index of the value to be removed from the selected list or single value +- [selected]: EnumOptionsType\["value"] | EnumOptionsType\["value"][] | undefined - The current (list of) selected value(s) +- [allEnumOptions=[]]: EnumOptionsType\[] - The list of all the known enumOptions #### Returns - EnumOptionsType\["value"][]: The updated `selected` list with the `value` removed from it +### enumOptionsIndexForValue\() +Returns the index(es) of the options in `allEnumOptions` whose value(s) match the ones in `value`. +All the `enumOptions` are filtered based on whether they are a "selected" `value` and the index of each selected one is then stored in an array. +If `multiple` is true, that array is returned, otherwise the first element in the array is returned. + +#### Parameters +- value: EnumOptionsType\["value"] | EnumOptionsType\["value"][] - The single value or list of values for which indexes are desired +- [allEnumOptions=[]]: EnumOptionsType\[] - The list of all the known enumOptions +- [multiple=false]: boolean - Optional flag, if true will return a list of index, otherwise a single one + +#### Returns +- string | string[] | undefined: A single string index for the first `value` in `allEnumOptions`, if not `multiple`. Otherwise, the list of indexes for (each of) the value(s) in `value`. + +### enumOptionsIsSelected\() +Determines whether the given `value` is (one of) the `selected` value(s). + +#### Parameters +- value: EnumOptionsType\["value"] - The value being checked to see if it is selected +- selected: EnumOptionsType\["value"] | EnumOptionsType\["value"][] - The current selected value or list of values +- [allEnumOptions=[]]: EnumOptionsType\[] - The list of all the known enumOptions + +#### Returns +- boolean: true if the `value` is one of the `selected` ones, false otherwise + ### enumOptionsSelectValue\() Add the `value` to the list of `selected` values in the proper order as defined by `allEnumOptions`. #### Parameters -- value: EnumOptionsType\["value"] - The value that should be selected +- valueIndex: string | number - The index of the value that should be selected - selected: EnumOptionsType\["value"][] - The current list of selected values -- allEnumOptions: EnumOptionsType\[] - The list of all the known enumOptions +- [allEnumOptions=[]]: EnumOptionsType\[] - The list of all the known enumOptions #### Returns - EnumOptionsType\["value"][]: The updated list of selected enum values with `value` added to it in the proper location +### enumOptionsValueForIndex\() +Returns the value(s) from `allEnumOptions` at the index(es) provided by `valueIndex`. +If `valueIndex` is not an array AND the index is not valid for `allEnumOptions`, `emptyValue` is returned. +If `valueIndex` is an array, AND it contains an invalid index, the returned array will have the resulting undefined values filtered out, leaving only valid values or in the worst case, an empty array. + +#### Parameters +- valueIndex: string | number | Array - The index(es) of the value(s) that should be returned +- [allEnumOptions=[]]: EnumOptionsType\[] - The list of all the known enumOptions +- [emptyValue]: EnumOptionsType\["value"] | undefined - The value to return when the non-array `valueIndex` does not refer to a real option +#### Returns +- EnumOptionsType\["value"] | EnumOptionsType\["value"][] | undefined: The single or list of values specified by the single or list of indexes if they are valid. Otherwise, `emptyValue` or an empty list. + ### errorId() Return a consistent `id` for the field error element. @@ -401,19 +440,6 @@ Parses the `dateString` into a `DateObject`, including the time information when #### Throws - Error when the date cannot be parsed from the string -### processSelectValue() -Returns the real value for a select widget due to a silly limitation in the DOM which causes option change event values to always be retrieved as strings. -Uses the `schema` to help determine the value's true type. -If the value is an empty string, then the `emptyValue` from the `options` is returned, falling back to undefined. - -#### Parameters -- schema: S - The schema to used to determine the value's true type -- [value]: any - The value to convert -- [options]: UIOptionsType | undefined - The UIOptionsType from which to potentially extract the `emptyValue` - -#### Returns -- string | boolean | number | string[] | boolean[] | number[] | undefined: The `value` converted to the proper type - ### rangeSpec\() Extracts the range spec information `{ step?: number, min?: number, max?: number }` that can be spread onto an HTML input from the range analog in the schema `{ multipleOf?: number, minimum?: number, maximum?: number }`. diff --git a/packages/antd/src/widgets/CheckboxesWidget/index.tsx b/packages/antd/src/widgets/CheckboxesWidget/index.tsx index 8a44f0cc59..1a1d5b3b05 100644 --- a/packages/antd/src/widgets/CheckboxesWidget/index.tsx +++ b/packages/antd/src/widgets/CheckboxesWidget/index.tsx @@ -2,6 +2,8 @@ import React from "react"; import Checkbox from "antd/lib/checkbox"; import { ariaDescribedByIds, + enumOptionsIndexForValue, + enumOptionsValueForIndex, optionId, FormContextType, WidgetProps, @@ -33,15 +35,22 @@ export default function CheckboxesWidget< }: WidgetProps) { const { readonlyAsDisabled = true } = formContext as GenericObjectType; - const { enumOptions, enumDisabled, inline } = options; + const { enumOptions, enumDisabled, inline, emptyValue } = options; - const handleChange = (nextValue: any) => onChange(nextValue); + const handleChange = (nextValue: any) => + onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue)); const handleBlur = ({ target }: React.FocusEvent) => - onBlur(id, target.value); + onBlur( + id, + enumOptionsValueForIndex(target.value, enumOptions, emptyValue) + ); const handleFocus = ({ target }: React.FocusEvent) => - onFocus(id, target.value); + onFocus( + id, + enumOptionsValueForIndex(target.value, enumOptions, emptyValue) + ); // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided, // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors @@ -51,18 +60,24 @@ export default function CheckboxesWidget< onFocus: !readonly ? handleFocus : undefined, }; + const selectedIndexes = enumOptionsIndexForValue( + value, + enumOptions, + true + ) as string[]; + return Array.isArray(enumOptions) && enumOptions.length > 0 ? ( (id)} > {Array.isArray(enumOptions) && enumOptions.map((option, i) => ( - + (id, option)} name={id} @@ -71,7 +86,7 @@ export default function CheckboxesWidget< Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1 } - value={option.value} + value={String(i)} > {option.label} diff --git a/packages/antd/src/widgets/RadioWidget/index.tsx b/packages/antd/src/widgets/RadioWidget/index.tsx index 02038b4bb0..1a09e9f6d0 100644 --- a/packages/antd/src/widgets/RadioWidget/index.tsx +++ b/packages/antd/src/widgets/RadioWidget/index.tsx @@ -2,6 +2,8 @@ import React from "react"; import Radio, { RadioChangeEvent } from "antd/lib/radio"; import { ariaDescribedByIds, + enumOptionsIndexForValue, + enumOptionsValueForIndex, optionId, FormContextType, GenericObjectType, @@ -29,21 +31,31 @@ export default function RadioWidget< onFocus, options, readonly, - schema, value, }: WidgetProps) { const { readonlyAsDisabled = true } = formContext as GenericObjectType; - const { enumOptions, enumDisabled } = options; + const { enumOptions, enumDisabled, emptyValue } = options; const handleChange = ({ target: { value: nextValue } }: RadioChangeEvent) => - onChange(schema.type === "boolean" ? nextValue !== "false" : nextValue); + onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue)); const handleBlur = ({ target }: React.FocusEvent) => - onBlur(id, target.value); + onBlur( + id, + enumOptionsValueForIndex(target.value, enumOptions, emptyValue) + ); const handleFocus = ({ target }: React.FocusEvent) => - onFocus(id, target.value); + onFocus( + id, + enumOptionsValueForIndex(target.value, enumOptions, emptyValue) + ); + + const selectedIndexes = enumOptionsIndexForValue( + value, + enumOptions + ) as string; return ( (id)} > {Array.isArray(enumOptions) && @@ -65,8 +77,8 @@ export default function RadioWidget< disabled={ Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1 } - key={option.value} - value={`${option.value}`} + key={i} + value={String(i)} > {option.label} diff --git a/packages/antd/src/widgets/SelectWidget/index.tsx b/packages/antd/src/widgets/SelectWidget/index.tsx index cd7379129d..de67cc386b 100644 --- a/packages/antd/src/widgets/SelectWidget/index.tsx +++ b/packages/antd/src/widgets/SelectWidget/index.tsx @@ -2,7 +2,8 @@ import React from "react"; import Select, { DefaultOptionType } from "antd/lib/select"; import { ariaDescribedByIds, - processSelectValue, + enumOptionsIndexForValue, + enumOptionsValueForIndex, FormContextType, GenericObjectType, RJSFSchema, @@ -36,21 +37,20 @@ export default function SelectWidget< options, placeholder, readonly, - schema, value, }: WidgetProps) { const { readonlyAsDisabled = true } = formContext as GenericObjectType; - const { enumOptions, enumDisabled } = options; + const { enumOptions, enumDisabled, emptyValue } = options; const handleChange = (nextValue: any) => - onChange(processSelectValue(schema, nextValue, options)); + onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue)); const handleBlur = () => - onBlur(id, processSelectValue(schema, value, options)); + onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue)); const handleFocus = () => - onFocus(id, processSelectValue(schema, value, options)); + onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue)); const filterOption = (input: string, option?: DefaultOptionType) => { if (option && isString(option.label)) { @@ -62,8 +62,11 @@ export default function SelectWidget< const getPopupContainer = (node: any) => node.parentNode; - const stringify = (currentValue: any) => - Array.isArray(currentValue) ? value.map(String) : String(value); + const selectedIndexes = enumOptionsIndexForValue( + value, + enumOptions, + multiple + ); // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided, // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors @@ -82,20 +85,20 @@ export default function SelectWidget< onFocus={!readonly ? handleFocus : undefined} placeholder={placeholder} style={SELECT_STYLE} - value={typeof value !== "undefined" ? stringify(value) : undefined} + value={selectedIndexes} {...extraProps} filterOption={filterOption} aria-describedby={ariaDescribedByIds(id)} > {Array.isArray(enumOptions) && - enumOptions.map(({ value: optionValue, label: optionLabel }) => ( + enumOptions.map(({ value: optionValue, label: optionLabel }, index) => ( {optionLabel} diff --git a/packages/antd/test/__snapshots__/Form.test.tsx.snap b/packages/antd/test/__snapshots__/Form.test.tsx.snap index b55621df85..0b10a44c5d 100644 --- a/packages/antd/test/__snapshots__/Form.test.tsx.snap +++ b/packages/antd/test/__snapshots__/Form.test.tsx.snap @@ -147,7 +147,7 @@ exports[`single fields checkboxes field 1`] = ` onKeyPress={[Function]} onKeyUp={[Function]} type="checkbox" - value="foo" + value="0" /> ) { - const { enumOptions, enumDisabled, inline } = options; + const { enumOptions, enumDisabled, inline, emptyValue } = options; const checkboxesValues = Array.isArray(value) ? value : [value]; const _onChange = - (option: any) => + (index: number) => ({ target: { checked } }: React.ChangeEvent) => { if (checked) { onChange( - enumOptionsSelectValue(option.value, checkboxesValues, enumOptions) + enumOptionsSelectValue(index, checkboxesValues, enumOptions) ); } else { - onChange(enumOptionsDeselectValue(option.value, checkboxesValues)); + onChange( + enumOptionsDeselectValue(index, checkboxesValues, enumOptions) + ); } }; const _onBlur = ({ target: { value } }: React.FocusEvent) => - onBlur(id, value); + onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue)); const _onFocus = ({ target: { value }, - }: React.FocusEvent) => onFocus(id, value); + }: React.FocusEvent) => + onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue)); return ( {Array.isArray(enumOptions) && enumOptions.map((option, index: number) => { - const checked = checkboxesValues.includes(option.value); + const checked = enumOptionsIsSelected( + option.value, + checkboxesValues + ); const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1; @@ -70,7 +78,7 @@ export default function CheckboxesWidget< name={id} label={option.label} autoFocus={autofocus && index === 0} - onChange={_onChange(option)} + onChange={_onChange(index)} onBlur={_onBlur} onFocus={_onFocus} disabled={disabled || itemDisabled || readonly} diff --git a/packages/bootstrap-4/src/RadioWidget/RadioWidget.tsx b/packages/bootstrap-4/src/RadioWidget/RadioWidget.tsx index 1dde8f42a8..85affa9e14 100644 --- a/packages/bootstrap-4/src/RadioWidget/RadioWidget.tsx +++ b/packages/bootstrap-4/src/RadioWidget/RadioWidget.tsx @@ -2,6 +2,8 @@ import React from "react"; import Form from "react-bootstrap/Form"; import { ariaDescribedByIds, + enumOptionsIsSelected, + enumOptionsValueForIndex, optionId, FormContextType, RJSFSchema, @@ -15,7 +17,6 @@ export default function RadioWidget< F extends FormContextType = any >({ id, - schema, options, value, required, @@ -25,41 +26,42 @@ export default function RadioWidget< onBlur, onFocus, }: WidgetProps) { - const { enumOptions, enumDisabled } = options; + const { enumOptions, enumDisabled, emptyValue } = options; const _onChange = ({ target: { value }, }: React.ChangeEvent) => - onChange(schema.type == "boolean" ? value !== "false" : value); + onChange(enumOptionsValueForIndex(value, enumOptions, emptyValue)); const _onBlur = ({ target: { value } }: React.FocusEvent) => - onBlur(id, value); + onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue)); const _onFocus = ({ target: { value }, - }: React.FocusEvent) => onFocus(id, value); + }: React.FocusEvent) => + onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue)); const inline = Boolean(options && options.inline); return ( {Array.isArray(enumOptions) && - enumOptions.map((option) => { + enumOptions.map((option, index) => { const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1; - const checked = option.value == value; + const checked = enumOptionsIsSelected(option.value, value); const radio = ( (id, option)} - key={option.value} + key={index} name={id} type="radio" disabled={disabled || itemDisabled || readonly} checked={checked} required={required} - value={option.value} + value={String(index)} onChange={_onChange} onBlur={_onBlur} onFocus={_onFocus} diff --git a/packages/bootstrap-4/src/SelectWidget/SelectWidget.tsx b/packages/bootstrap-4/src/SelectWidget/SelectWidget.tsx index 15c61afe15..b92f07037a 100644 --- a/packages/bootstrap-4/src/SelectWidget/SelectWidget.tsx +++ b/packages/bootstrap-4/src/SelectWidget/SelectWidget.tsx @@ -3,7 +3,8 @@ import Form from "react-bootstrap/Form"; import { ariaDescribedByIds, FormContextType, - processSelectValue, + enumOptionsIndexForValue, + enumOptionsValueForIndex, RJSFSchema, StrictRJSFSchema, WidgetProps, @@ -29,7 +30,7 @@ export default function SelectWidget< placeholder, rawErrors = [], }: WidgetProps) { - const { enumOptions, enumDisabled } = options; + const { enumOptions, enumDisabled, emptyValue: optEmptyValue } = options; const emptyValue = multiple ? [] : ""; @@ -46,6 +47,11 @@ export default function SelectWidget< return event.target.value; } } + const selectedIndexes = enumOptionsIndexForValue( + value, + enumOptions, + multiple + ); return ( { const newValue = getValue(event, multiple); - onBlur(id, processSelectValue(schema, newValue, options)); + onBlur( + id, + enumOptionsValueForIndex(newValue, enumOptions, optEmptyValue) + ); }) } onFocus={ onFocus && ((event: React.FocusEvent) => { const newValue = getValue(event, multiple); - onFocus(id, processSelectValue(schema, newValue, options)); + onFocus( + id, + enumOptionsValueForIndex(newValue, enumOptions, optEmptyValue) + ); }) } onChange={(event: React.ChangeEvent) => { const newValue = getValue(event, multiple); - onChange(processSelectValue(schema, newValue, options)); + onChange( + enumOptionsValueForIndex(newValue, enumOptions, optEmptyValue) + ); }} aria-describedby={ariaDescribedByIds(id)} > @@ -87,7 +103,7 @@ export default function SelectWidget< Array.isArray(enumDisabled) && (enumDisabled as any).indexOf(value) != -1; return ( - ); diff --git a/packages/bootstrap-4/test/__snapshots__/Array.test.tsx.snap b/packages/bootstrap-4/test/__snapshots__/Array.test.tsx.snap index 5aa50d4149..09b3ce08a3 100644 --- a/packages/bootstrap-4/test/__snapshots__/Array.test.tsx.snap +++ b/packages/bootstrap-4/test/__snapshots__/Array.test.tsx.snap @@ -549,21 +549,21 @@ exports[`array fields checkboxes 1`] = ` diff --git a/packages/bootstrap-4/test/__snapshots__/Form.test.tsx.snap b/packages/bootstrap-4/test/__snapshots__/Form.test.tsx.snap index 2d6e8abcfc..29f7e3786f 100644 --- a/packages/bootstrap-4/test/__snapshots__/Form.test.tsx.snap +++ b/packages/bootstrap-4/test/__snapshots__/Form.test.tsx.snap @@ -954,7 +954,7 @@ exports[`single fields radio field 1`] = ` onChange={[Function]} onFocus={[Function]} type="radio" - value={true} + value="0" />