Skip to content

Commit

Permalink
fixup: form input ref
Browse files Browse the repository at this point in the history
  • Loading branch information
jopedroliveira committed Dec 19, 2022
1 parent 0f58827 commit d19c331
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions renderer/src/components/FilAddressForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const FilAddressForm: FC<FilAddressFormProps> = ({ destinationAddress = '', save
const [addressIsValid, setAddressIsValid] = useState<boolean | undefined>()
const [inputAddr, setInputAddr] = useState<string>(destinationAddress)
const [internalEditMode, setInternalEditMode] = useState<boolean>(false)
const ref = useRef(null)
const ref = useRef<HTMLInputElement>(null)

useEffect(() => {
setInternalEditMode(editMode || destinationAddress === '')
Expand Down Expand Up @@ -48,7 +48,7 @@ const FilAddressForm: FC<FilAddressFormProps> = ({ destinationAddress = '', save
if (addressIsValid) {
saveDestinationAddress(inputAddr)
}
ref.current.blur()
if (ref.current) { ref.current.blur() }
}

const computeBorderClasses = () => {
Expand Down

0 comments on commit d19c331

Please sign in to comment.