From 4cbbcc8a409a286d8e36080658445cd720200a37 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 15 Dec 2022 14:10:59 +0800 Subject: [PATCH 1/5] auto upgrade version to 2.0.20221215141039 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 45b3d3453..fed0f3d7f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221214115751", + "version": "2.0.20221215141039", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 1a986da1b681260dbeacc7db90a4928b6d0487cf Mon Sep 17 00:00:00 2001 From: data Date: Thu, 15 Dec 2022 14:46:37 +0800 Subject: [PATCH 2/5] auto upgrade version to 2.0.20221215144622 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fed0f3d7f..b7377dc76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221215141039", + "version": "2.0.20221215144622", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From e01442ef69c7f8001d86954b6cc5d2461ebd3578 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 15 Dec 2022 16:17:06 +0800 Subject: [PATCH 3/5] =?UTF-8?q?BI-118849=20fix:=20combo=E5=9C=A8=E5=B1=8F?= =?UTF-8?q?=E5=B9=95=E8=BE=B9=E7=BC=98,=E5=B7=A6=E5=8F=B3=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=8D=E5=A4=9F=E4=B9=8B=E5=90=8E=E7=9A=84=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E8=B0=83=E6=95=B4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/dom.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/core/platform/web/dom.js b/src/core/platform/web/dom.js index 9b1026683..74a1a2a28 100644 --- a/src/core/platform/web/dom.js +++ b/src/core/platform/web/dom.js @@ -250,12 +250,12 @@ _getLeftAlignPosition: function (combo, popup, extraWidth, container) { var comboRect = combo.element[0].getBoundingClientRect(), - popupRect = popup.element.bounds(), + popupRect = popup.element[0].getBoundingClientRect(), viewportRect = document.documentElement.getBoundingClientRect(), containerRect = container ? container.getBoundingClientRect() : { left: 0 }; var left = comboRect.left - containerRect.left + extraWidth; - if (left + popupRect.width - containerRect.left > viewportRect.width) { + if (comboRect.left + popupRect.width > viewportRect.width) { left = viewportRect.width - popupRect.width - containerRect.left; } return left; @@ -265,12 +265,13 @@ var left = this._getLeftAlignPosition(combo, popup, extraWidth, container); var dir = ""; // 如果放不下,优先使用RightAlign, 如果RightAlign也放不下, 再使用left=0 - if (left < 0) { + var containerRect = container ? container.getBoundingClientRect() : { left: 0 }; + if (left + containerRect.left < 0) { left = this._getRightAlignPosition(combo, popup, extraWidth); dir = "left"; } - if (left < 0) { - left = 0; + if (left + containerRect.left < 0) { + left = 0 - containerRect.left; } return { left: left, @@ -678,8 +679,8 @@ getComboPosition: function (combo, popup, extraWidth, extraHeight, needAdaptHeight, directions, offsetStyle, positionRelativeElement) { extraWidth || (extraWidth = 0); extraHeight || (extraHeight = 0); - var bodyHeight = BI.Widget._renderEngine.createElement("body").bounds().height - extraHeight; - var maxHeight = Math.min(popup.attr("maxHeight") || bodyHeight, bodyHeight); + var viewportBounds = document.documentElement.getBoundingClientRect(); + var maxHeight = Math.min(popup.attr("maxHeight") || viewportBounds.height, viewportBounds.height); popup.resetHeight && popup.resetHeight(maxHeight); var position = BI.DOM.getComboPositionByDirections(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions || ["bottom", "top", "right", "left"], positionRelativeElement); switch (offsetStyle) { @@ -703,7 +704,7 @@ break; } if (needAdaptHeight === true) { - popup.resetHeight && popup.resetHeight(Math.min(bodyHeight - position.top + (positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0), maxHeight)); + popup.resetHeight && popup.resetHeight(Math.min(viewportBounds.height - position.top + (positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0), maxHeight)); } return position; }, From 7d3e424259aff4a85abadcc529b35b1d6da70146 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 15 Dec 2022 17:15:53 +0800 Subject: [PATCH 4/5] auto upgrade version to 2.0.20221215171537 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b7377dc76..211e2bb1c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221215144622", + "version": "2.0.20221215171537", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From a3b0412925921055ce07e0f8ac3bf732663bb898 Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 15 Dec 2022 21:52:09 +0800 Subject: [PATCH 5/5] =?UTF-8?q?BI-119055=20fix:=20needadaptive=E7=9A=84?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E8=AE=A1=E7=AE=97NaN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/dom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/platform/web/dom.js b/src/core/platform/web/dom.js index 74a1a2a28..7d6ac59ea 100644 --- a/src/core/platform/web/dom.js +++ b/src/core/platform/web/dom.js @@ -413,7 +413,7 @@ }, getBottomAdaptPosition: function (combo, popup, extraHeight, needAdaptHeight) { - var comboBounds = combo.element.bounds(), popupBounds = popup.element.bounds(), + var comboBounds = combo.element[0].getBoundingClientRect(), popupBounds = popup.element[0].getBoundingClientRect(), windowBounds = BI.Widget._renderEngine.createElement("body").bounds(); if (BI.DOM.isBottomSpaceEnough(combo, popup, extraHeight)) { return BI.DOM.getBottomPosition(combo, popup, extraHeight);