Skip to content

fix(material/select): arrow highlighted state not updating in Safari #15281

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
Feb 23, 2022
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
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will override the above styles which are applying transform: translateY. Is there another way that can force Safari to redraw?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved the transform to a different element.

}
}

.mat-select-panel-wrap {
Expand Down