Skip to content

charton API


charton API / @chart-on/ui / index / popoverPlacement

Function: popoverPlacement() ​

popoverPlacement(trigger, list, viewport, options?, margin?, gap?): PopoverPlacement

Defined in: ui/src/dom.ts:254

Where a dropdown list fits: flips it to the trigger's right edge when the left-aligned list would cross the viewport's right edge and the flipped one overflows less, and caps its height to the room below (or above, up) the trigger. gap is the space between trigger and list.

Parameters ​

trigger ​

bottom ​

number

left ​

number

number

top ​

number

list ​

height ​

number

width ​

number

viewport ​

height ​

number

width ​

number

options? ​

alignEnd? ​

boolean

up? ​

boolean

margin? ​

number = 8

gap? ​

number = 4

Returns ​

PopoverPlacement