From 776daa61ba6786828562b96ba750f65744f812b9 Mon Sep 17 00:00:00 2001 From: Anshul Bansal Date: Wed, 7 Oct 2020 12:37:16 +0530 Subject: [PATCH] Auto Focus on email fields in auth screens (#923) Fixes: #610 Co-authored-by: Anshul --- app/client/src/components/editorComponents/InputComponent.tsx | 2 ++ .../src/components/editorComponents/form/FormTextField.tsx | 1 + app/client/src/pages/UserAuth/Login.tsx | 1 + app/client/src/pages/UserAuth/SignUp.tsx | 1 + 4 files changed, 5 insertions(+) diff --git a/app/client/src/components/editorComponents/InputComponent.tsx b/app/client/src/components/editorComponents/InputComponent.tsx index 54eb6bf008..d077c5d422 100644 --- a/app/client/src/components/editorComponents/InputComponent.tsx +++ b/app/client/src/components/editorComponents/InputComponent.tsx @@ -18,6 +18,7 @@ type InputComponentProps = { type?: InputType; intent?: Intent; disabled?: boolean; + autoFocus?: boolean; }; const InputComponent = (props: InputComponentProps) => { @@ -28,6 +29,7 @@ const InputComponent = (props: InputComponentProps) => { placeholder={props.placeholder} type={props.type} intent={props.intent as BlueprintIntent} + autoFocus={props.autoFocus} /> ); }; diff --git a/app/client/src/components/editorComponents/form/FormTextField.tsx b/app/client/src/components/editorComponents/form/FormTextField.tsx index 0a32000a9d..5d7b7a9ee1 100644 --- a/app/client/src/components/editorComponents/form/FormTextField.tsx +++ b/app/client/src/components/editorComponents/form/FormTextField.tsx @@ -32,6 +32,7 @@ type FormTextFieldProps = { label?: string; intent?: Intent; disabled?: boolean; + autoFocus?: boolean; }; const FormTextField = (props: FormTextFieldProps) => { diff --git a/app/client/src/pages/UserAuth/Login.tsx b/app/client/src/pages/UserAuth/Login.tsx index d3d7f600b3..2bbe38c74b 100644 --- a/app/client/src/pages/UserAuth/Login.tsx +++ b/app/client/src/pages/UserAuth/Login.tsx @@ -131,6 +131,7 @@ export const Login = (props: LoginFormProps) => { name={LOGIN_FORM_EMAIL_FIELD_NAME} type="email" placeholder={LOGIN_PAGE_EMAIL_INPUT_PLACEHOLDER} + autoFocus /> { name="email" type="email" placeholder={SIGNUP_PAGE_EMAIL_INPUT_PLACEHOLDER} + autoFocus />