Skip to content

Commit 38e492f

Browse files
crisbetommalerba
authored andcommitted
fix(form-field): native select outline not reset on firefox (#12967)
Currently we reset the focus outline for the `select` inside a form field for all browsers, however Firefox adds its own outline on top of it. These changes remove the extra Firefox outline since we have other focus indication already. For reference: ![angular_material_-_mozilla_firefox_2018-09-03_22-08-46](https://user-images.githubusercontent.com/4450522/45000622-df53da00-afc6-11e8-8eb6-41716417025f.png)
1 parent 966cf5f commit 38e492f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/lib/input/input.scss

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ $mat-native-select-arrow-svg: '' +
131131

132132
// Remove the native select down arrow and replace it with material design arrow
133133
select.mat-input-element {
134-
&::-ms-expand {
135-
display: none;
136-
}
137134
-moz-appearance: none;
138135
-webkit-appearance: none;
139136
position: relative;
@@ -149,6 +146,17 @@ select.mat-input-element {
149146
background-image: url($mat-native-select-arrow-svg);
150147
}
151148

149+
&::-ms-expand {
150+
display: none;
151+
}
152+
153+
// The `outline: none` from `.mat-input-element` works on all browsers, however Firefox also
154+
// adds a special `focus-inner` which we have to disable explicitly. See:
155+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Firefox
156+
&::-moz-focus-inner {
157+
border: 0;
158+
}
159+
152160
[dir='rtl'] & {
153161
background-position: left center;
154162
}

0 commit comments

Comments
 (0)