Skip to content

Commit 0a412e9

Browse files
committed
fix(SelectWidget): render empty string for undefined values instead of undefined
1 parent eaa6a51 commit 0a412e9

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,48 @@ should change the heading of the (upcoming) version to include a major version b
2222

2323
- Forward `required` to `BaseInputTemplate` so that required string and number fields render the HTML `required` attribute, fixing [#3743](https://github.com/rjsf-team/react-jsonschema-form/issues/3743)
2424

25+
## @rjsf/chakra-ui
26+
27+
- Fixed `SelectWidget` rendering array indices instead of real enum values when `nameGenerator` is active, breaking native form submission ([#4693](https://github.com/rjsf-team/react-jsonschema-form/issues/4693))
28+
2529
## @rjsf/core
2630

2731
- Fixed a breaking change introduced in v6.4.0 where array properties with enum items no longer used `ui:enumNames` from the array property's uiSchema ([#4985](https://github.com/rjsf-team/react-jsonschema-form/issues/4985))
2832
- Passed `parentUiSchema` to `ArrayFieldItem` to maintain `uiSchema`, this prop was introduced recently but was not being passed
2933
- Fixed `extraErrors` not displaying when `customErrors` are also present (e.g., with array fields and controlled `formData`), fixing [#4982](https://github.com/rjsf-team/react-jsonschema-form/issues/4982)
34+
- Fixed `SelectWidget` rendering array indices instead of real enum values when `nameGenerator` is active, breaking native form submission ([#4693](https://github.com/rjsf-team/react-jsonschema-form/issues/4693))
35+
36+
## @rjsf/daisyui
37+
38+
- Fixed `SelectWidget` rendering array indices instead of real enum values when `nameGenerator` is active, breaking native form submission ([#4693](https://github.com/rjsf-team/react-jsonschema-form/issues/4693))
39+
40+
## @rjsf/fluentui-rc
41+
42+
- Fixed `SelectWidget` rendering array indices instead of real enum values when `nameGenerator` is active, breaking native form submission ([#4693](https://github.com/rjsf-team/react-jsonschema-form/issues/4693))
43+
44+
## @rjsf/mantine
45+
46+
- Fixed `SelectWidget` rendering array indices instead of real enum values when `nameGenerator` is active, breaking native form submission ([#4693](https://github.com/rjsf-team/react-jsonschema-form/issues/4693))
47+
48+
## @rjsf/mui
49+
50+
- Fixed `SelectWidget` rendering array indices instead of real enum values when `nameGenerator` is active, breaking native form submission ([#4693](https://github.com/rjsf-team/react-jsonschema-form/issues/4693))
51+
52+
## @rjsf/primereact
53+
54+
- Fixed `SelectWidget` rendering array indices instead of real enum values when `nameGenerator` is active, breaking native form submission ([#4693](https://github.com/rjsf-team/react-jsonschema-form/issues/4693))
55+
56+
## @rjsf/react-bootstrap
57+
58+
- Fixed `SelectWidget` rendering array indices instead of real enum values when `nameGenerator` is active, breaking native form submission ([#4693](https://github.com/rjsf-team/react-jsonschema-form/issues/4693))
59+
60+
## @rjsf/semantic-ui
61+
62+
- Fixed `SelectWidget` rendering array indices instead of real enum values when `nameGenerator` is active, breaking native form submission ([#4693](https://github.com/rjsf-team/react-jsonschema-form/issues/4693))
63+
64+
## @rjsf/shadcn
65+
66+
- Fixed `SelectWidget` rendering array indices instead of real enum values when `nameGenerator` is active, breaking native form submission ([#4693](https://github.com/rjsf-team/react-jsonschema-form/issues/4693))
3067

3168
# 6.4.1
3269

packages/shadcn/src/SelectWidget/SelectWidget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default function SelectWidget<
6868
useRealValues
6969
? value !== undefined
7070
? String(value)
71-
: undefined
71+
: ''
7272
: (enumOptionsIndexForValue<S>(value ?? defaultValue, enumOptions, false) as unknown as string)
7373
}
7474
onValueChange={(selectedValue) => {

0 commit comments

Comments
 (0)