Skip to content

Commit

Permalink
fix(material/select): fix arrow alignment (#25626)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalerba committed Sep 14, 2022
1 parent fd9d326 commit 9be94a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/material/form-field/_form-field-native-select.scss
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
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

0 comments on commit 9be94a0

Please sign in to comment.