Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(select): select no longer overflows window, resizes from small to…
Browse files Browse the repository at this point in the history
… big correctly

closes #5291
  • Loading branch information
rschmukler committed Nov 20, 2015
1 parent 086b756 commit ee4ab18
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/select/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,8 @@ function SelectProvider($$interimElementProvider) {

if (contentNode.offsetWidth > maxWidth) {
contentNode.style['max-width'] = maxWidth + 'px';
} else {
contentNode.style.maxWidth = null;
}
if (shouldOpenAroundTarget) {
contentNode.style['min-width'] = targetRect.width + 'px';
Expand Down Expand Up @@ -1379,7 +1381,7 @@ function SelectProvider($$interimElementProvider) {
transformOrigin = (centeredRect.left + targetRect.width / 2) + 'px ' +
(centeredRect.top + centeredRect.height / 2 - contentNode.scrollTop) + 'px 0px';

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

// Keep left and top within the window
Expand Down

1 comment on commit ee4ab18

@dianagastrin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stopped work when updating to this verison(1.0.0-rc5). in 1.0.0-rc4 it works perfect. but now, with 1.0.0-rc5 till 1.0.4 it not worrks, it makes all the site crash when pressing md-select. what could be the problem? thank you..

<md-input-container flex>
<md-select ng-model="product.paymentCode" name="paymentCode"  md-on-open="loadPaymentCode()" placeholder="Payment Code"  required>
        <md-option ng-value="rPaymentCode" ng-selected="rPaymentCode.id==product.paymentCode.id" ng-repeat="rPaymentCode in paymentCodes">{{ rPaymentCode.code}}</md-option>
 </md-select>''
    <div ng-messages="createProductForm.paymentCode.$error" ng-show="createProductForm.paymentCode.$touched">
        <div ng-message="required">choose payment code</div>
    </div>
    <tr-clear model-to-clear="product.paymentCode" ng-if="product.paymentCode"></tr-clear>
</md-input-container>`'

Please sign in to comment.