Skip to content

fix(material/select): fix arrow alignment #25626

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
Sep 14, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/material/form-field/_form-field-native-select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ $mat-form-field-select-horizontal-end-padding: $mat-form-field-select-arrow-widt
border-top: $mat-form-field-select-arrow-height solid;
position: absolute;
right: 0;
top: 50%;
margin-top: -#{math.div($mat-form-field-select-arrow-height, 2)};

// Make the arrow non-clickable so the user can click on the form control under it.
pointer-events: none;
Expand Down
8 changes: 6 additions & 2 deletions src/material/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ $scale: 0.75 !default;
display: inline-flex;
align-items: center;

// When used in a box appearance form-field the arrow should be shifted up 40%.
// When used in a fill appearance with a label, form-field the arrow should be shifted up 8px.
.mat-form-field-appearance-fill & {
transform: translateY(-40%);
transform: translateY(-8px);
}

.mat-form-field-appearance-fill .mdc-text-field--no-label & {
transform: none;
}
}

Expand Down