Browse Source

BI-154136 fix: 按钮被遮挡

master
Jimmy.Chai 3 months ago
parent
commit
06435006a4
  1. 5
      packages/fineui/src/core/utils/dom.js

5
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));
}
}

Loading…
Cancel
Save