Skip to content

Commit

Permalink
fix(material/select): arrow highlighted state not updating in Safari (#…
Browse files Browse the repository at this point in the history
…15281)

Fixes the color of the select arrow not updating correctly when focusing and blurring in Safari. It seems like Safari wasn't recalculating the styles, for some reason.
  • Loading branch information
crisbeto committed Feb 23, 2022
1 parent 6d8693d commit 1d5175b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/material/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ $placeholder-arrow-space: 2 * ($arrow-size + $arrow-margin);
border-right: $arrow-size solid transparent;
border-top: $arrow-size solid;
margin: 0 $arrow-margin;

// On Safari the arrow won't necessarily get redrawn when the form field is focused or blurred,
// which means that its highlighted styling will be stuck in an incorrect state. We can get
// Safari to redraw it by adding a transform.
.mat-form-field.mat-focused & {
transform: translateX(0);
}
}

.mat-select-panel-wrap {
Expand Down

0 comments on commit 1d5175b

Please sign in to comment.