diff --git a/src/core/platform/web/dom.js b/src/core/platform/web/dom.js index d45ccc3b2..66e970b56 100644 --- a/src/core/platform/web/dom.js +++ b/src/core/platform/web/dom.js @@ -384,11 +384,11 @@ if (BI.DOM.isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { top = comboOffset.top + comboBounds.height - containerBounds.top - popupBounds.height; } else if (needAdaptHeight) { - top = 0; - adaptHeight = comboOffset.top + comboBounds.height - extraHeight; + top = 0 - containerBounds.top; + adaptHeight = comboBounds.top + comboBounds.height - extraHeight; } else if (BI.DOM.isBottomSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) { // 上方空间不足且不允许调整高度的情况下,优先使用下对齐 - top = comboOffset.top + extraHeight; + top = comboOffset.top - containerBounds.top + extraHeight; dir = "bottom"; } else { top = 0; @@ -396,7 +396,7 @@ adaptHeight = windowBounds.height - extraHeight; } } - if (top < 0) { + if (top + containerBounds.top < 0) { top = 0; } return adaptHeight ? {