Position (utils/dom)
@ckeditor/ckeditor5-utils/src/dom/position
A position class which instances are created and used by the getOptimalPosition
helper.
top
and left
properties of the position instance
translate directly to the top
and left
properties in CSS "position: absolute
coordinate system". If set on the positioned element
in DOM, they will make it display it in the right place in the viewport.
Filtering
Properties
-
Additional position configuration, as passed from the positioning function.
This object can be use, for instance, to pass through presentation options used by the consumer of the
getOptimalPosition
helper. -
The left value in pixels in the CSS
position: absolute
coordinate system. Set it on the positioned element in DOM to move it to the position. -
Position name.
-
The top value in pixels in the CSS
position: absolute
coordinate system. Set it on the positioned element in DOM to move it to the position. -
An already absolutely positioned element rect. See (
_rect
). -
private readonly
_limiterIntersectionArea : Number
module:utils/dom/position~Position#_limiterIntersectionArea
An intersection area between positioned element and limiter within viewport constraints.
-
An already positioned element rect. A clone of the element rect passed to the constructor but placed in the viewport according to the positioning function.
-
private readonly
_viewportIntersectionArea : Number
module:utils/dom/position~Position#_viewportIntersectionArea
An intersection area between positioned element and viewport.
Methods
-
constructor( [ positioningFunction ], [ options ] = { options.elementRect, options.targetRect, options.viewportRect, [options.positionedElementAncestor] } )
module:utils/dom/position~Position#constructor
Creates an instance of the
Position
class.Parameters
[ positioningFunction ] : PositioningFunction
function The function that defines the expected coordinates the positioned element should move to.
[ options ] : Object
options object.
Properties
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.