Skip to content

fix(form-field): clear safari autofill icons #12137

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

Merged
merged 1 commit into from
Jul 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/lib/input/input.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import '../core/style/variables';
@import '../core/style/vendor-prefixes';


// The Input element proper.
.mat-input-element {
// Font needs to be inherited, because by default <input> has a system font.
Expand Down Expand Up @@ -39,10 +38,19 @@
}

// Remove IE's default clear and reveal icons.
&::-ms-clear, &::-ms-reveal {
&::-ms-clear,
&::-ms-reveal {
display: none;
}

// Also clear Safari's autofill icons. Note that this can't be in the
// same selector as the IE ones, otherwise Safari will ignore it.
&::-webkit-contacts-auto-fill-button,
&::-webkit-caps-lock-indicator,
&::-webkit-credentials-auto-fill-button {
visibility: hidden;
}

// Fixes an issue on iOS where the following input types will collapse to 1px,
// if they're empty, because we've overridden their background color.
// See: https://stackoverflow.com/questions/18381594/input-type-date-appearance-in-safari-on-ios
Expand Down