Last active
May 9, 2023 01:31
-
-
Save jeroenvisser101/9254cf27df85cf1c853aee17e4b49766 to your computer and use it in GitHub Desktop.
Hide Safari contacts auto-fill when [autocomplete="off"]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input[autocomplete="off"]::-webkit-contacts-auto-fill-button { | |
visibility: hidden; | |
display: none !important; | |
pointer-events: none; | |
height: 0; | |
width: 0; | |
margin: 0; | |
} |
Hello, you can try use autocomplete="new-password"
- its crutch, but its works for me
it still is flaky and might not work for different versions
input[autocomplete="off"]::-webkit-contacts-auto-fill-button,
input[autocomplete="off"]::-webkit-credentials-auto-fill-button {
visibility: hidden;
display: none !important;
pointer-events: none;
height: 0;
width: 0;
margin: 0;
}
It also works for me!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@z5h, @vidit1, so if anyone reads this (this is the first page i've found in google about this topic), here is my solution about the safari dropdown
basically, safari will scan the name, the placeholder and the label of the field. if it sees anything relevant, it will trigger the dropdown. the solution is to store the name in a data-name attribute and restore it on submit. As for the label, what I've done is to use a zero width joiner to garble the label while keeping it readable.
sample jquery code below to give an idea, not very good, but working