-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Safari tries to fill username #25
Comments
Upon further investigation this seems like an absolutely crazy Safari bug and I'm not sure if it can be worked around or not. I noticed that this was only happening on one page of our app. So I systematically commented out each section of HTML to see if any block was affecting it and I found one! I narrowed it down to a single I thought the word "back" might be making Safari think this was a login page for some reason? So I removed it and it fixed the issue! Crazy. Out of curiosity I tried removing "Welcome" and adding "back" back in. Still didn't re-occur. ?! So it seems only the combination of words "welcome back" causes this to happen. Absolutely no idea why. To confirm I chose another page randomly and put the phrase "welcome back" in a random position on the page and low and behold it caused this to happen again. For some reason the presence of these words on the page is adding the following to the Shadow DOM of the input field:
Easily the most bizarre bug I've ever come across. |
On further consideration I don't think it's a bug. I think Safari is assuming any page with "Welcome Back" on it is a login page and enabling this behaviour. Therefore I think it's intended. |
Nice one. I found that using a non-breaking space prevents the behaviour.
|
LOL 😂 Make sure to add a comment (with a link) to your code to document why that |
"Log in" works too. I tried a couple other languages (Finnish, German, French, Chinese) but the issue/feature seems to only happen with English (although I did use Google Translate, so I can't guarantee I used the right idioms). |
This issue is at top of hacker news right now, there have been a lot of comments speculating why this is here. |
|
Interesting issue 🤓 feel free to continue the discussion. |
Safari offers autocomplete if there is a word "username" inside of a label. There are 2 solutions I found to prevent this:
|
The text was updated successfully, but these errors were encountered: