From 74ccf2f8cc678319e8883737ccb921eb5ac77a12 Mon Sep 17 00:00:00 2001 From: chenzeyu Date: Tue, 7 May 2024 14:54:47 +0800 Subject: [PATCH] =?UTF-8?q?BI-148103=20fix:=206.0.18=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=B8=8B=E6=8B=89=E6=A1=86=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=8F=98=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/utils/dom.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/fineui/src/core/utils/dom.js b/packages/fineui/src/core/utils/dom.js index fbee6b287..1be70de14 100644 --- a/packages/fineui/src/core/utils/dom.js +++ b/packages/fineui/src/core/utils/dom.js @@ -744,10 +744,11 @@ export function getComboPosition(combo, popup, extraWidth, extraHeight, needAdap if (needAdaptHeight === true && popup.resetHeight) { const comboRect = combo.element[0].getBoundingClientRect(); const relativeOffset = positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0; - if (position.top < comboRect.top) { - popup.resetHeight(Math.min(viewportBounds.height - position.top - relativeOffset, comboRect.top, maxHeight)); - } else if (position.top >= comboRect.bottom) { - popup.resetHeight(Math.min(viewportBounds.height - position.top - relativeOffset, viewportBounds.height - comboRect.bottom, maxHeight)); + const positionTop = position.top + relativeOffset; + if (positionTop < comboRect.top) { + popup.resetHeight(Math.min(viewportBounds.height - positionTop, comboRect.top, maxHeight)); + } else if (positionTop >= comboRect.bottom) { + popup.resetHeight(Math.min(viewportBounds.height - positionTop, viewportBounds.height - comboRect.bottom, maxHeight)); } }