ContextMenuPosition
Properties
attachToXBy
OptionalTells what side of the context menu widget should be used to "attach" to a provided x coordinate.
If the value is undefined
, then you may treat it based on whether it is rtl or not (e.g. 'right'
for rtl and 'left'
otherwise).
Type
"left" | "right"
attachToYBy
OptionalTells what side of the context menu widget should be used to "attach" to a provided y coordinate:
'auto'
means similar to'top'
but the menu could be expanded above the coordinate if needed (if there is no enough space to place it below)'auto-strict'
means'top'
if the whole menu fits the space below the coordinate and'bottom'
otherwise (see boxHeight)'top'
means that the menu should be placed to the bottom of y coordinate (the menu should be attached by its bottom to y coordinate)'bottom'
means that the menu should be placed above y coordinate (the menu should be attached by its top to y coordinate)
You may treat undefined
as 'auto'
.
Type
"auto" | "top" | "bottom" | "auto-strict"
boxHeight
OptionalThe height of a box the context menu should avoid while calculating coordinates (see attachToYBy).
You may treat undefined
as 0
.
Type
number
clientX
X (horizontal) coordinate (in pixels) at which the mouse event occurred, relative to the left edge of the applications viewport.
Type
number
clientY
Y (vertical) coordinate (in pixels) at which the mouse event occurred, relative to the left edge of the applications viewport.
Type
number
touches
OptionalTouch positions
Type
readonly { clientX: number ; clientY: number }[]