diff --git a/packages/widget/src/components/SendToWallet/SendToWallet.tsx b/packages/widget/src/components/SendToWallet/SendToWallet.tsx index 7cb56727f..e424f2b94 100644 --- a/packages/widget/src/components/SendToWallet/SendToWallet.tsx +++ b/packages/widget/src/components/SendToWallet/SendToWallet.tsx @@ -12,7 +12,7 @@ import { FormControl, Input } from './SendToWallet.style'; export const SendToWallet: React.FC = forwardRef((props, ref) => { const { t } = useTranslation(); - const { trigger, getValues, clearErrors } = useFormContext(); + const { trigger, getValues, setValue, clearErrors } = useFormContext(); const { account } = useWallet(); const { disabledUI, hiddenUI, requiredUI, toAddress } = useWidgetConfig(); const { showSendToWallet, showSendToWalletDirty, setSendToWallet } = @@ -31,6 +31,9 @@ export const SendToWallet: React.FC = forwardRef((props, ref) => { rules: { required: requiredToAddress && (t('error.title.walletAddressRequired') as string), + onChange: (e) => { + setValue(FormKey.ToAddress, e.target.value.trim()); + }, validate: async (value: string) => { try { if (!value) {