From 6b711bc1e37ee7b5288b5c3e6567c8bc07d0657f Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 8 May 2023 15:28:47 +0800 Subject: [PATCH] =?UTF-8?q?BI-125791=20fix:=20=E3=80=906.0.10=E5=8F=91?= =?UTF-8?q?=E6=95=A3=E3=80=91=E7=BB=84=E4=BB=B6=E7=BC=96=E8=BE=91=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E7=82=B9=E5=87=BB=E8=A7=A6=E5=8F=91=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=A7=A3=E9=87=8A=E7=9A=84=E7=83=AD=E5=8C=BA=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E7=9A=84=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E4=BC=9A=E5=8F=98=E6=9D=A5=E5=8F=98=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/base/combination/combo.js | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/packages/fineui/src/base/combination/combo.js b/packages/fineui/src/base/combination/combo.js index 0721ba9e0..e3c5f5db8 100644 --- a/packages/fineui/src/base/combination/combo.js +++ b/packages/fineui/src/base/combination/combo.js @@ -267,34 +267,34 @@ export class Combo extends Bubble { belowMouse && isNotNull(e) ? { element: { - 0: e.target, - offset: () => { + 0: extend({}, e.target, { + getBoundingClientRect: function () { + return { + left: e.pageX, + top: e.pageY, + width: 0, + height: 0, + }; + } + }), + offset: function () { return { left: e.pageX, top: e.pageY, }; }, - bounds: () => { - // offset为其相对于父定位元素的偏移 - return { - x: e.offsetX, - y: e.offsetY, - width: 0, - height: 24, - }; - }, - outerWidth: () => 0, - outerHeight: () => 24, }, } : this.combo; - const positionRelativeElement = supportCSSTransform - ? DOM.getPositionRelativeContainingBlock( - isNull(container) - ? this.element[0] - : Widget._renderEngine.createElement(isFunction(container) ? container() : container)[0] - ) - : null; + + const positionRelativeElement = DOM.getPositionRelativeContainingBlock( + isNull(container) + ? this.element[0] + : BI.isWidget(container) + ? container.element[0] + : BI.Widget._renderEngine.createElement(isFunction(container) ? container() : container)[0] + ); + const TRIANGLE_LENGTH = 12; switch (direction) { case "bottom": @@ -513,8 +513,14 @@ export class Combo extends Bubble { const scaleX = positonedRect.width / positionRelativeElement.offsetWidth; const scaleY = positonedRect.height / positionRelativeElement.offsetHeight; - p.top && (p.top = p.top / scaleY); - p.left && (p.left = p.left / scaleX); + p.top && (p.top = Math.round(p.top / scaleY + positionRelativeElement.scrollTop)); + p.left && (p.left = Math.round(p.left / scaleX + positionRelativeElement.scrollLeft)); + + p.adaptHeight && (p.adaptHeight = Math.round(p.adaptHeight / scaleY)); + } + + if ("adaptHeight" in p) { + this.resetListHeight(p.adaptHeight); } if ("left" in p) {