diff --git a/apps/tx-builder/src/components/forms/fields/SelectContractField.tsx b/apps/tx-builder/src/components/forms/fields/SelectContractField.tsx index 75b0c9021..c6016f586 100644 --- a/apps/tx-builder/src/components/forms/fields/SelectContractField.tsx +++ b/apps/tx-builder/src/components/forms/fields/SelectContractField.tsx @@ -1,5 +1,7 @@ -import { Select } from '@gnosis.pm/safe-react-components' +import Autocomplete from '@mui/material/Autocomplete' +import { TextFieldInput } from '@gnosis.pm/safe-react-components' import { SelectItem } from '@gnosis.pm/safe-react-components/dist/inputs/Select' +import { type SyntheticEvent, useCallback, useMemo } from 'react' type SelectContractFieldTypes = { options: SelectItem[] @@ -18,21 +20,36 @@ const SelectContractField = ({ name, id, }: SelectContractFieldTypes) => { + const selectedValue = useMemo(() => options.find(opt => opt.id === value), [options, value]) + + const onValueChange = useCallback( + (e: SyntheticEvent, value: SelectItem | null) => { + if (value) { + onChange(value.id) + } + }, + [onChange], + ) + return ( -