Skip to content

bug(md-select): change the arrow position to absolute #3602

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

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 8 additions & 0 deletions src/lib/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,22 @@ $mat-select-trigger-font-size: 16px !default;
}

.mat-select-arrow {
position: absolute;
right: 0;
width: 0;
height: 0;
border-left: $mat-select-arrow-size solid transparent;
border-right: $mat-select-arrow-size solid transparent;
border-top: $mat-select-arrow-size solid;
margin: 0 $mat-select-arrow-margin;

[dir='rtl'] & {
right: auto;
left: 0;
}
}


.mat-select-panel {
@include mat-menu-base();
padding-top: 0;
Expand Down
5 changes: 3 additions & 2 deletions src/lib/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,11 @@ export class MdSelect implements AfterContentInit, ControlValueAccessor, OnDestr
/**
* Must set the width of the selected option's value programmatically
* because it is absolutely positioned and otherwise will not clip
* overflow. The selection arrow is 9px wide, add 4px of padding = 13
* overflow. The selection arrow is 5px wide, with 4px on each margin.
* add 4px of padding = 17
*/
private _setValueWidth() {
this._selectedValueWidth = this._triggerWidth - 13;
this._selectedValueWidth = this._triggerWidth + 17;
}

/**
Expand Down