diff --git a/src/components/forms/FormMultiselect.tsx b/src/components/forms/FormMultiselect.tsx index 5279776..5dfd283 100644 --- a/src/components/forms/FormMultiselect.tsx +++ b/src/components/forms/FormMultiselect.tsx @@ -34,12 +34,17 @@ export function FormMultiselect({label, validity, pairProps, labelProps, onSimpl [onSimpleChange, options] ) + const optionComponents = React.useMemo( + () => Object.keys(options).map(key => ), + [options], + ) + return ( {label}} input={ - {Object.keys(options).map(key => )} + {optionComponents} } validity={validity} diff --git a/src/components/forms/FormSelect.tsx b/src/components/forms/FormSelect.tsx index 9771935..3da509e 100644 --- a/src/components/forms/FormSelect.tsx +++ b/src/components/forms/FormSelect.tsx @@ -3,6 +3,7 @@ import * as ReactDOM from "react-dom" import * as Types from "../../types" import {BaseElement} from "../BaseElement" import mergeClassNames from "classnames" +import {Multiselect} from "../inputs/Multiselect" import {FormPair, FormPairProps} from "./FormPair"; import {FormLabel, FormLabelProps} from "./FormLabel"; import {Select, SelectProps} from "../inputs/Select"; @@ -33,12 +34,17 @@ export function FormSelect({label, validity, options, pairProps, labelProps, onS [onSimpleChange, options] ) + const optionComponents = React.useMemo( + () => Object.keys(options).map(key => ), + [options], + ) + return ( {label}} input={ } validity={validity}