From 06435006a4471815fcc3baeee56ce914f4afe746 Mon Sep 17 00:00:00 2001 From: "Jimmy.Chai" Date: Tue, 20 Aug 2024 14:04:16 +0800 Subject: [PATCH] =?UTF-8?q?BI-154136=20fix:=20=E6=8C=89=E9=92=AE=E8=A2=AB?= =?UTF-8?q?=E9=81=AE=E6=8C=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/utils/dom.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/fineui/src/core/utils/dom.js b/packages/fineui/src/core/utils/dom.js index 1be70de14..0530cfe95 100644 --- a/packages/fineui/src/core/utils/dom.js +++ b/packages/fineui/src/core/utils/dom.js @@ -743,12 +743,13 @@ export function getComboPosition(combo, popup, extraWidth, extraHeight, needAdap } if (needAdaptHeight === true && popup.resetHeight) { const comboRect = combo.element[0].getBoundingClientRect(); + const scale = comboRect.height / combo.element.height(); const relativeOffset = positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0; const positionTop = position.top + relativeOffset; if (positionTop < comboRect.top) { - popup.resetHeight(Math.min(viewportBounds.height - positionTop, comboRect.top, maxHeight)); + popup.resetHeight(Math.min((viewportBounds.height - positionTop) / scale, comboRect.top / scale, maxHeight)); } else if (positionTop >= comboRect.bottom) { - popup.resetHeight(Math.min(viewportBounds.height - positionTop, viewportBounds.height - comboRect.bottom, maxHeight)); + popup.resetHeight(Math.min((viewportBounds.height - positionTop) / scale, (viewportBounds.height - comboRect.bottom) / scale, maxHeight)); } }