@nolwenture/formik-jsonschema-form 1.3.0 → 1.3.1
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.
|
@@ -14,7 +14,7 @@ const MultipleChoiceField = (props) => {
|
|
|
14
14
|
const { values } = (0, formik_1.useFormikContext)();
|
|
15
15
|
const value = (0, formik_1.getIn)(values, name);
|
|
16
16
|
const selected = (0, utils_1.getSelectedEnum)(value, enums);
|
|
17
|
-
const notSelected = enums?.values?.filter((v) => Array.isArray(value)
|
|
17
|
+
const notSelected = enums?.values?.filter((v) => Array.isArray(value) ? !value.includes(v.const) : value !== v.const);
|
|
18
18
|
const hideNotSelected = onlyShowSelected === true || selected === undefined;
|
|
19
19
|
const SelectedFieldTemplate = (props.uiSchema?.["ui:template"] &&
|
|
20
20
|
templates[props.uiSchema?.["ui:template"]]) ??
|
|
@@ -11,7 +11,7 @@ export const MultipleChoiceField = (props) => {
|
|
|
11
11
|
const { values } = useFormikContext();
|
|
12
12
|
const value = getIn(values, name);
|
|
13
13
|
const selected = getSelectedEnum(value, enums);
|
|
14
|
-
const notSelected = enums?.values?.filter((v) => Array.isArray(value)
|
|
14
|
+
const notSelected = enums?.values?.filter((v) => Array.isArray(value) ? !value.includes(v.const) : value !== v.const);
|
|
15
15
|
const hideNotSelected = onlyShowSelected === true || selected === undefined;
|
|
16
16
|
const SelectedFieldTemplate = (props.uiSchema?.["ui:template"] &&
|
|
17
17
|
templates[props.uiSchema?.["ui:template"]]) ??
|