positioningFunction (utils/dom)
@ckeditor/ckeditor5-utils/src/dom/position
Parameters
elementRect : Rect
The rect of the element to be positioned.
targetRect : Rect
The rect of the target the element (its rect) is relatively positioned to.
viewportRect : Rect
The rect of the visual browser viewport.
Returns
Object | null
return When the function returns
null
, it will not be considered bygetOptimalPosition
.Number
return.top The
top
value of the element rect that would represent the position.Number
return.left The
left
value of the element rect that would represent the position.Number
return.name The name of the position. It helps the user of the
getOptimalPosition
helper to recognize different positioning function results. It will pass through to thePosition
returned by the helper.Number
[return.config] An optional configuration that will pass-through the
getOptimalPosition
helper to thePosition
returned by this helper. This configuration may, for instance, let the user ofgetOptimalPosition
know that this particular position comes with a certain presentation.
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.