Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect autofill in safari #31600

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions web/packages/shared/components/MenuLogin/MenuLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ const LoginItemList = ({
<Input
p="2"
m="2"
// this prevents safari from adding the autofill options which would cover the available logins and make it
// impossible to select. "But why would it do that? this isn't a username or password field?".
// Safari includes parsed words in the placeholder as well to determine if that autofill should show.
// Since our placeholder has the word "login" in it, it thinks its a login form.
// https://github.com/gravitational/teleport/pull/31600
// https://stackoverflow.com/questions/22661977/disabling-safari-autofill-on-usernames-and-passwords
name="notsearch_password"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add explanation here? because i found it pretty strange too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

onKeyPress={onKeyPress}
type="text"
autoFocus
Expand Down