Function: popoverBelow()
popoverBelow(
anchor,popoverWidth,viewportWidth,margin?):object
Defined in: src/ui/elements/PcPopover/index.ts:22
Where a popover goes under its anchor: centred below it (leaving room for the arrow), moved sideways as far as needed
to stay in the window, with its arrow still pointing at the anchor's centre (arrowX, from the popover's left).
Parameters
anchor
bottom
number
left
number
width
number
popoverWidth
number
viewportWidth
number
margin?
number = POPOVER_MARGIN
Returns
object
arrowX
arrowX:
number
left
left:
number
top
top:
number
Example
popoverBelow({ left: 100, bottom: 40, width: 40 }, 200, 1000); // { left: 20, top: 48, arrowX: 100 }
popoverBelow({ left: 0, bottom: 40, width: 40 }, 200, 1000); // { left: 8, top: 48, arrowX: 12 }