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): floating label overlapping elements above select #6228

Merged
merged 1 commit into from
Aug 2, 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
6 changes: 5 additions & 1 deletion src/lib/select/_select-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@
}

@mixin mat-select-typography($config) {
$trigger-font-size: mat-font-size($config, subheading-2);

.mat-select {
// Reserve enough space for the floating placeholder.
padding-top: $trigger-font-size;
font-family: mat-font-family($config);
}

.mat-select-trigger {
font-size: mat-font-size($config, subheading-2);
font-size: $trigger-font-size;
}
}
6 changes: 3 additions & 3 deletions src/lib/select/select.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ describe('MdSelect', () => {
// these styles are necessary because we are first testing the overlay's position
// if there is room for it to open to its full extent in either direction.
select.style.position = 'fixed';
select.style.top = '300px';
select.style.top = '285px';
select.style.left = '20px';
});

Expand Down Expand Up @@ -1194,9 +1194,9 @@ describe('MdSelect', () => {

// Scroll should adjust by the difference between the top space available (85px + 8px
// viewport padding = 77px) and the height of the panel above the option (113px).
// 113px - 77px = 36px difference + original scrollTop 88px = 124px
// 113px - 93px = 20px difference + original scrollTop 88px = 108px
expect(scrollContainer.scrollTop)
.toEqual(124, `Expected panel to adjust scroll position to fit in viewport.`);
.toEqual(108, `Expected panel to adjust scroll position to fit in viewport.`);

checkTriggerAlignedWithOption(4);
});
Expand Down