diff --git a/src/components/common/AddressInput/index.tsx b/src/components/common/AddressInput/index.tsx index 007b703d9a..8e691edafb 100644 --- a/src/components/common/AddressInput/index.tsx +++ b/src/components/common/AddressInput/index.tsx @@ -1,5 +1,5 @@ import type { ReactElement } from 'react' -import { useEffect, useCallback, useRef, useMemo, useState } from 'react' +import { useEffect, useCallback, useRef, useMemo } from 'react' import { InputAdornment, TextField, @@ -47,7 +47,7 @@ const AddressInput = ({ register, setValue, control, - formState: { errors }, + formState: { errors, isValidating }, trigger, } = useFormContext() @@ -55,7 +55,6 @@ const AddressInput = ({ const rawValueRef = useRef('') const watchedValue = useWatch({ name, control }) const currentShortName = currentChain?.shortName || '' - const [isValidating, setIsValidating] = useState(false) // Fetch an ENS resolution for the current address const isDomainLookupEnabled = !!currentChain && hasFeature(currentChain, FEATURES.DOMAIN_LOOKUP) @@ -154,17 +153,11 @@ const AddressInput = ({ return parsePrefixedAddress(cleanValue).address }, - validate: async (inputValue) => { + validate: async () => { const value = rawValueRef.current - // Validation unmounts QR code otherwise - if (inputValue === value) return - if (value) { - setIsValidating(true) - const result = validatePrefixed(value) || (await validate?.(parsePrefixedAddress(value).address)) - setIsValidating(false) - return result + return validatePrefixed(value) || (await validate?.(parsePrefixedAddress(value).address)) } },