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