1
Fork 0
mirror of https://github.com/Steffo99/bluelib.git synced 2024-12-22 11:34:21 +00:00

🐛 Fix #17 for Selects

This commit is contained in:
Steffo 2022-03-12 05:27:21 +01:00
parent ffba0c9bd0
commit e677bb5785
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -39,7 +39,7 @@ export function FormSelect<T>({label, validity, options, pairProps, labelProps,
) )
const optionComponents = React.useMemo( const optionComponents = React.useMemo(
() => Object.entries(options).map(([optKey, optValue]) => <Select.Option value={optKey} key={optKey} selected={value === optValue}/>), () => Object.entries(options).map(([optKey, optValue]) => <Select.Option value={optKey} key={optKey}/>),
[options], [options],
) )
@ -47,7 +47,7 @@ export function FormSelect<T>({label, validity, options, pairProps, labelProps,
<FormPair <FormPair
label={<FormLabel {...labelProps}>{label}</FormLabel>} label={<FormLabel {...labelProps}>{label}</FormLabel>}
input={ input={
<Select onSimpleChange={onSimpleChangeWrapped} {...props}> <Select onSimpleChange={onSimpleChangeWrapped} value={value} {...props}>
{optionComponents} {optionComponents}
</Select> </Select>
} }