@rjsf/core 5.19.2 → 5.19.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.umd.js +5 -4
- package/dist/index.esm.js +5 -4
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +5 -4
- package/dist/index.js.map +2 -2
- package/lib/components/widgets/SelectWidget.js +5 -4
- package/lib/components/widgets/SelectWidget.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/components/widgets/SelectWidget.tsx +5 -4
package/dist/index.js
CHANGED
|
@@ -3049,23 +3049,24 @@ function SelectWidget({
|
|
|
3049
3049
|
const newValue = getValue(event, multiple);
|
|
3050
3050
|
return onFocus(id, (0, import_utils32.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyVal));
|
|
3051
3051
|
},
|
|
3052
|
-
[onFocus, id, schema, multiple,
|
|
3052
|
+
[onFocus, id, schema, multiple, enumOptions, optEmptyVal]
|
|
3053
3053
|
);
|
|
3054
3054
|
const handleBlur = (0, import_react14.useCallback)(
|
|
3055
3055
|
(event) => {
|
|
3056
3056
|
const newValue = getValue(event, multiple);
|
|
3057
3057
|
return onBlur(id, (0, import_utils32.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyVal));
|
|
3058
3058
|
},
|
|
3059
|
-
[onBlur, id, schema, multiple,
|
|
3059
|
+
[onBlur, id, schema, multiple, enumOptions, optEmptyVal]
|
|
3060
3060
|
);
|
|
3061
3061
|
const handleChange = (0, import_react14.useCallback)(
|
|
3062
3062
|
(event) => {
|
|
3063
3063
|
const newValue = getValue(event, multiple);
|
|
3064
3064
|
return onChange((0, import_utils32.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyVal));
|
|
3065
3065
|
},
|
|
3066
|
-
[onChange, schema, multiple,
|
|
3066
|
+
[onChange, schema, multiple, enumOptions, optEmptyVal]
|
|
3067
3067
|
);
|
|
3068
3068
|
const selectedIndexes = (0, import_utils32.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
3069
|
+
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
3069
3070
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3070
3071
|
"select",
|
|
3071
3072
|
{
|
|
@@ -3082,7 +3083,7 @@ function SelectWidget({
|
|
|
3082
3083
|
onChange: handleChange,
|
|
3083
3084
|
"aria-describedby": (0, import_utils32.ariaDescribedByIds)(id),
|
|
3084
3085
|
children: [
|
|
3085
|
-
|
|
3086
|
+
showPlaceholderOption && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: "", children: placeholder }),
|
|
3086
3087
|
Array.isArray(enumOptions) && enumOptions.map(({ value: value2, label }, i) => {
|
|
3087
3088
|
const disabled2 = enumDisabled && enumDisabled.indexOf(value2) !== -1;
|
|
3088
3089
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: String(i), disabled: disabled2, children: label }, i);
|