Browse Source

Pull request #288091: BI-154136 fix: 按钮被遮挡

Merge in DEC/fineui from ~JIMMY.CHAI/dec-fineui:feature/x to feature/x

* commit '06435006a4471815fcc3baeee56ce914f4afe746':
  BI-154136 fix: 按钮被遮挡
master
Jimmy.Chai-柴嘉明 5 months ago
parent
commit
48e2ba0f9a
  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