Skip to content

Commit

Permalink
feat: add autocomplete attributes on passwordless form fields (#747)
Browse files Browse the repository at this point in the history
* feat: add autocomplete attributes on passwordless form fields

* chore: bump version

---------

Co-authored-by: Rishabh Poddar <rishabh.poddar@gmail.com>
  • Loading branch information
porcellus and rishabhpoddar committed Oct 6, 2023
1 parent 77ea80d commit efef688
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)

## [0.35.5] - 2023-10-05
## [0.35.5] - 2023-10-06

### Changes

- Setting `autocomplete` in passwordless forms for email, phone and OTP

### Fixes

Expand Down
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 efef688

Please sign in to comment.