Fix SolidityAddressInput value not displayed properly (#4428)

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR improves the handling of local input state in the `AddressInput` component by introducing a new local state variable `_localInput`.

### Detailed summary
- Introduces `_localInput` state variable using `useState`
- Modifies `localInput` assignment logic to consider `_localInput`
- Updates usage of `localInput` in the component to reflect the changes

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
This commit is contained in:
MananTank
2024-09-06 00:15:16 +00:00
parent 0c73b344c0
commit a3d76835ed
@@ -14,8 +14,9 @@ export const SolidityAddressInput: React.FC<SolidityInputProps> = ({
}) => {
const { name, ...restOfInputProps } = inputProps;
const inputName = name as string;
const [_localInput, setLocalInput] = useState<string | undefined>();
const inputNameWatch = form.watch(inputName);
const [localInput, setLocalInput] = useState(inputNameWatch);
const localInput = _localInput === undefined ? inputNameWatch : _localInput;
const address = useActiveAccount()?.address;
const ensQuery = useEns(localInput);