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