Adding autocomplete custom change

This commit is contained in:
honzapatCZ 2026-08-27 17:19:32 +02:00
parent 316998f5f7
commit 1d86cf1fe1

View File

@ -84,9 +84,12 @@ export function AutocompleteSelect<T>({ title, titleProps = null, data, nullable
}
onChange={(value) => {
// If value is an object (from internalData lookup), store only the primitive .value
field.onChange({ target: { value, name: field.name } });
}
const event = { target: { value, name: field.name } };
field.onChange(event);
if (props.onChange) {
(props.onChange as any)(event);
}
}}
nullable={nullable as any}
>
<div css={[title && tw`my-1`, tw`relative`]} >