Browse Source

Merge pull request #265104 in DEC/fineui from master to feature/x

* commit '4beee63274b05e0a094fde5de3524e40911fbd9f':
  BI-144444 fix: 【v5】过滤组件向下展示不下,向上弹出的时候会挡住仪表板的tab栏,体验不好,看下能不能优化
master
superman 9 months ago
parent
commit
8ae09c2833
  1. 10
      packages/fineui/src/core/utils/dom.js

10
packages/fineui/src/core/utils/dom.js

@ -741,8 +741,14 @@ export function getComboPosition(combo, popup, extraWidth, extraHeight, needAdap
default:
break;
}
if (needAdaptHeight === true) {
popup.resetHeight && popup.resetHeight(Math.min(viewportBounds.height - position.top - (positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0), maxHeight));
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));
}
}
return position;

Loading…
Cancel
Save