Skip to content

Commit

Permalink
feat: add autocomplete attributes on passwordless form fields
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Oct 5, 2023
1 parent e84e083 commit 4968278
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/build/passwordless-shared3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const EmailForm = withOverride(
optional: false,
autofocus: true,
placeholder: "",
autoComplete: "email",
// We are using the default validator that allows any string
validate: defaultValidate,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export const EmailOrPhoneForm = withOverride(
optional: false,
autofocus: true,
placeholder: "",
// We do not add an autocomplete prop in this case, since we do not really have any sensible option to set
// Setting them to either "tel" or "email" would give people the wrong impression since this could have either
// AFAIK we can't set them both at the same time
validate: defaultValidate,
},
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const PhoneForm = withOverride(
optional: false,
autofocus: true,
placeholder: "",
autoComplete: "tel",
validate: defaultValidate,
},
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export const UserInputCodeForm = withOverride(
autofocus: true,
optional: false,
clearOnSubmit: true,
autoComplete: "one-time-code",
placeholder: "",
validate: userInputCodeValidate,
},
Expand Down

0 comments on commit 4968278

Please sign in to comment.