Composer / Embedded Message / Menu: Fix height
This commit is contained in:
parent
da6f094d41
commit
ff72279f1c
@ -340,6 +340,7 @@ const MessageContextMenu: FC<OwnProps> = ({
|
||||
getRootElement={getRootElement}
|
||||
getMenuElement={getMenuElement}
|
||||
getLayout={getLayout}
|
||||
withMaxHeight
|
||||
className={buildClassName(
|
||||
'MessageContextMenu', 'fluid', withReactions && 'with-reactions',
|
||||
)}
|
||||
|
||||
@ -23,6 +23,7 @@ interface DynamicPositionOptions {
|
||||
getRootElement: () => HTMLElement | null;
|
||||
getMenuElement: () => HTMLElement | null;
|
||||
getLayout?: () => Layout;
|
||||
withMaxHeight?: boolean;
|
||||
}
|
||||
|
||||
export type MenuPositionOptions =
|
||||
@ -122,6 +123,7 @@ function processDynamically(
|
||||
getMenuElement,
|
||||
getTriggerElement,
|
||||
getLayout,
|
||||
withMaxHeight,
|
||||
}: DynamicPositionOptions,
|
||||
) {
|
||||
const triggerEl = getTriggerElement()!;
|
||||
@ -214,10 +216,14 @@ function processDynamically(
|
||||
const transformOriginX = positionX === 'left' ? offsetX : menuRect.width + offsetX;
|
||||
const transformOriginY = positionY === 'bottom' ? menuRect.height + offsetY : offsetY;
|
||||
|
||||
const menuMaxHeight = rootRect.height - MENU_POSITION_BOTTOM_MARGIN - (marginTop || 0);
|
||||
const bubbleStyle = `max-height: ${menuMaxHeight}px;`;
|
||||
const style = `left: ${left}px; top: ${top}px`;
|
||||
|
||||
let bubbleStyle;
|
||||
if (withMaxHeight) {
|
||||
const menuMaxHeight = rootRect.height - MENU_POSITION_BOTTOM_MARGIN - (marginTop || 0);
|
||||
bubbleStyle = `max-height: ${menuMaxHeight}px;`;
|
||||
}
|
||||
|
||||
return {
|
||||
positionX,
|
||||
positionY,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user