Skip to content

Commit

Permalink
Merge pull request #781 from eisbuk/feature/focus-login-fields
Browse files Browse the repository at this point in the history
Auto focus particular fields for each login step (for all flows)
  • Loading branch information
silviot authored Jul 11, 2023
2 parents a4ce928 + 9aab6dc commit 4d6b34c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ const titleLookup = {
*/
const fieldsLookup: AuthTextFieldLookup<EmailAuthStep> = {
[EmailAuthStep.SignInWithEmail]: [
{ name: "email", label: "Email", type: "email" },
{ name: "email", label: "Email", type: "email", autoFocus: true },
],
[EmailAuthStep.SignInWithEmailPassword]: [
{ name: "email", label: "Email", type: "email" },
{ name: "password", label: "Password", type: "password" },
{ name: "password", label: "Password", type: "password", autoFocus: true },
],
[EmailAuthStep.CreateAccountEmailPassword]: [
{ name: "email", label: "Email", type: "email" },
{ name: "password", label: "Password", type: "password" },
{ name: "password", label: "Password", type: "password", autoFocus: true },
],
[EmailAuthStep.RecoverEmailPassword]: [
{ name: "email", label: "Email", type: "email" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ const fieldsLookup: AuthTextFieldLookup<EmailLinkAuthStep> = Object.values(
? {
...acc,
// all auth steps except for `EmailLinkAuthStep.CheckSignInEmail` have the same (email) input field
[authStep]: [{ name: "email", label: "Email", type: "email" }],
[authStep]: [
{ name: "email", label: "Email", type: "email", autoFocus: true },
],
}
: acc,
{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ const fieldsLookup: AuthTextFieldLookup<PhoneAuthStep> = {
label: "Phone",
type: "tel",
inputMode: "tel",
autoFocus: true,
},
],
[PhoneAuthStep.EnterSMSCode]: [
Expand All @@ -209,6 +210,7 @@ const fieldsLookup: AuthTextFieldLookup<PhoneAuthStep> = {
label: "SMS Code",
type: "text",
inputMode: "numeric",
autoFocus: true,
},
],
};
Expand Down

0 comments on commit 4d6b34c

Please sign in to comment.