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

Commit ee4ab18

Browse files
committed
fix(select): select no longer overflows window, resizes from small to big correctly
closes #5291
1 parent 086b756 commit ee4ab18

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/select/select.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,8 @@ function SelectProvider($$interimElementProvider) {
13171317

13181318
if (contentNode.offsetWidth > maxWidth) {
13191319
contentNode.style['max-width'] = maxWidth + 'px';
1320+
} else {
1321+
contentNode.style.maxWidth = null;
13201322
}
13211323
if (shouldOpenAroundTarget) {
13221324
contentNode.style['min-width'] = targetRect.width + 'px';
@@ -1379,7 +1381,7 @@ function SelectProvider($$interimElementProvider) {
13791381
transformOrigin = (centeredRect.left + targetRect.width / 2) + 'px ' +
13801382
(centeredRect.top + centeredRect.height / 2 - contentNode.scrollTop) + 'px 0px';
13811383

1382-
minWidth = targetRect.width + centeredRect.paddingLeft + centeredRect.paddingRight;
1384+
minWidth = Math.min(targetRect.width + centeredRect.paddingLeft + centeredRect.paddingRight, maxWidth);
13831385
}
13841386

13851387
// Keep left and top within the window

0 commit comments

Comments
 (0)