Skip to content

Commit 183ee52

Browse files
crisbetovictoriaaa234
authored andcommitted
fix(form-field): clear safari autofill icons (#12137)
Similarly to how we clear the native IE icons, these changes clear Safari's autofill icons so they don't interfere with our own styling.
1 parent 0b653df commit 183ee52

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/lib/input/input.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import '../core/style/variables';
22
@import '../core/style/vendor-prefixes';
33

4-
54
// The Input element proper.
65
.mat-input-element {
76
// Font needs to be inherited, because by default <input> has a system font.
@@ -39,10 +38,19 @@
3938
}
4039

4140
// Remove IE's default clear and reveal icons.
42-
&::-ms-clear, &::-ms-reveal {
41+
&::-ms-clear,
42+
&::-ms-reveal {
4343
display: none;
4444
}
4545

46+
// Also clear Safari's autofill icons. Note that this can't be in the
47+
// same selector as the IE ones, otherwise Safari will ignore it.
48+
&::-webkit-contacts-auto-fill-button,
49+
&::-webkit-caps-lock-indicator,
50+
&::-webkit-credentials-auto-fill-button {
51+
visibility: hidden;
52+
}
53+
4654
// Fixes an issue on iOS where the following input types will collapse to 1px,
4755
// if they're empty, because we've overridden their background color.
4856
// See: https://stackoverflow.com/questions/18381594/input-type-date-appearance-in-safari-on-ios

0 commit comments

Comments
 (0)