Skip to content

EditorView.coordsAtPos method

EditorView › coordsAtPos

Official

Get the screen coordinates at the given document position.

Signature:

coordsAtPos(pos: number, side?: 1 | -1 | undefined): null | Rect

Parameters:

ParameterTypeDescription
posnumberThe document position.
side?1 | -1 | undefinedWhich side to get coordinates for.

Returns: null | RectThe rectangle or null.