Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
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
7 changes: 5 additions & 2 deletions src/components/select/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ function SelectProvider($$interimElementProvider) {
}
}

var left, top, transformOrigin, minWidth;
var left, top, transformOrigin, minWidth, fontSize;
if (shouldOpenAroundTarget) {
left = targetRect.left;
top = targetRect.top + targetRect.height;
Expand All @@ -1503,6 +1503,8 @@ function SelectProvider($$interimElementProvider) {
(centeredRect.top + centeredRect.height / 2 - contentNode.scrollTop) + 'px 0px';

minWidth = Math.min(targetRect.width + centeredRect.paddingLeft + centeredRect.paddingRight, maxWidth);

fontSize = window.getComputedStyle(targetNode)['font-size'];
}

// Keep left and top within the window
Expand All @@ -1516,7 +1518,8 @@ function SelectProvider($$interimElementProvider) {
styles: {
left: Math.floor(clamp(bounds.left, left, bounds.right - containerRect.width)),
top: Math.floor(clamp(bounds.top, top, bounds.bottom - containerRect.height)),
'min-width': minWidth
'min-width': minWidth,
'font-size': fontSize
}
},
dropDown: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ md-input-container.md-input-has-value ._md-select-value {
position: relative;
top: 2px;
speak: none;
font-size: 16px;
transform: scaleY(0.6) scaleX(1);
}

Expand Down Expand Up @@ -272,7 +273,6 @@ md-option {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: rem(1.6);
}
padding: 0 $select-option-padding 0 $select-option-padding;
height: $select-option-height;
Expand Down
3 changes: 3 additions & 0 deletions src/core/util/animation/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ function AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) {
case 'transformOrigin':
convertToVendor(key, $mdConstant.CSS.TRANSFORM_ORIGIN, value);
break;
case 'font-size':
css['font-size'] = value; // font sizes aren't always in px
break;
}
}
});
Expand Down