diff --git a/packages/keychain/src/components/Auth/Login.tsx b/packages/keychain/src/components/Auth/Login.tsx index caef20ce3..ccd9b4f40 100644 --- a/packages/keychain/src/components/Auth/Login.tsx +++ b/packages/keychain/src/components/Auth/Login.tsx @@ -109,7 +109,7 @@ export function Login({ placeholder="Username" validate={validateUsernameFor("login")} > - {({ field, meta }) => ( + {({ field, meta, form }) => ( form.setFieldValue(field.name, "")} /> )} diff --git a/packages/keychain/src/components/Auth/Signup.tsx b/packages/keychain/src/components/Auth/Signup.tsx index 9306a4dd1..800d8031d 100644 --- a/packages/keychain/src/components/Auth/Signup.tsx +++ b/packages/keychain/src/components/Auth/Signup.tsx @@ -21,7 +21,6 @@ import { client } from "utils/graphql"; import { PopupCenter } from "utils/url"; import { FormValues, SignupProps } from "./types"; import { isIframe, validateUsernameFor } from "./utils"; -import { useClearField } from "./hooks"; import { RegistrationLink } from "./RegistrationLink"; import { doSignup } from "hooks/account"; import { useControllerTheme } from "hooks/theme"; @@ -36,7 +35,7 @@ export function Signup({ }: SignupProps) { const [isRegistering, setIsRegistering] = useState(false); const [isLoading, setIsLoading] = useState(false); - const [error, setError] = useState(new Error("errorrrrrrrrrrr")); + const [error, setError] = useState(); const onSubmit = useCallback(async (values: FormValues) => { setIsLoading(true); @@ -171,8 +170,6 @@ function Form({ }, ); - const onClearUsername = useClearField("username"); - const onLogin = useCallback(() => { onLoginProp(values.username); }, [values.username, onLoginProp]); @@ -194,14 +191,14 @@ function Form({ placeholder="Username" validate={validateUsernameFor("signup")} > - {({ field, meta }) => ( + {({ field, meta, form }) => ( form.setFieldValue(field.name, "")} isLoading={isValidating} /> )} diff --git a/packages/ui/src/components/Field.tsx b/packages/ui/src/components/Field.tsx index cbddc94a7..61d998cf1 100644 --- a/packages/ui/src/components/Field.tsx +++ b/packages/ui/src/components/Field.tsx @@ -67,7 +67,7 @@ export function Field({ cursor={isActive ? "pointer" : "default"} opacity={isActive ? 100 : 0} // workaround for onBlur handler triggeres before onClear > - + ) )}