Skip to content
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

fix(select): not trimming long labels #2444

Merged
merged 2 commits into from
Jan 20, 2017
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: 1 addition & 1 deletion src/demo-app/select/select-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class SelectDemo {

drinks = [
{value: 'coke-0', viewValue: 'Coke'},
{value: 'sprite-1', viewValue: 'Sprite'},
{value: 'long-name-1', viewValue: 'Decaf Chocolate Brownie Vanilla Gingerbread Frappuccino'},
{value: 'water-2', viewValue: 'Water'},
{value: 'pepper-3', viewValue: 'Dr. Pepper'},
{value: 'coffee-4', viewValue: 'Coffee'},
Expand Down
6 changes: 3 additions & 3 deletions src/lib/core/style/_menu-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ $md-menu-side-padding: 16px !default;
@mixin md-menu-item-base() {
@include md-truncate-line();

display: flex;
flex-direction: row;
align-items: center;
// Needs to be a block for the ellipsis to work.
display: block;
line-height: $md-menu-item-height;
height: $md-menu-item-height;
padding: 0 $md-menu-side-padding;

Expand Down
1 change: 1 addition & 0 deletions src/lib/menu/_menu-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

md-icon {
color: md-color($foreground, 'icon');
vertical-align: middle;
}

&:hover:not([disabled]), &:focus:not([disabled]) {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ md-select {
}

.md-select-value {
position: absolute;
@include md-truncate-line();
position: absolute;
max-width: calc(100% - #{$md-select-arrow-size * 2});

// Firefox and some versions of IE incorrectly keep absolutely
// positioned children of flex containers in the flex flow when calculating
Expand Down