Options (utils/dom)
@ckeditor/ckeditor5-utils/src/dom/position
The getOptimalPosition()
helper options.
Filtering
Properties
-
element : HTMLElement
module:utils/dom/position~Options#element
Element that is to be positioned.
-
fitInViewport : Boolean
module:utils/dom/position~Options#fitInViewport
When set, the algorithm will chose such a position which fits
element
the most inside visible viewport. -
limiter : HTMLElement | Range | Window | ClientRect | DOMRect | Rect | Object | function
module:utils/dom/position~Options#limiter
When set, the algorithm will chose position which fits the most in the limiter's bounding rect.
-
positions : Array.<positioningFunction>
module:utils/dom/position~Options#positions
An array of positioning functions.
Note: Positioning functions are processed in the order of preference. The first function that works in the current environment (e.g. offers the complete fit in the viewport geometry) will be picked by
getOptimalPosition()
.Note: Any positioning function returning
null
is ignored. -
target : HTMLElement | Range | Window | ClientRect | DOMRect | Rect | Object | function
module:utils/dom/position~Options#target
Target with respect to which the
element
is to be positioned. -
viewportOffsetConfig : Object
module:utils/dom/position~Options#viewportOffsetConfig
Viewport offset config object. It restricts the visible viewport available to the
getOptimalPosition()
from each side.{ top: 50, right: 50, bottom: 50, left: 50 }
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.