Skip to content

EditorView.posAtCoords method

EditorView › posAtCoords

Official

Get the document position at the given screen coordinates. Returns null if not found.

Signature:

posAtCoords(coords: EditorViewCoords): null | number

Parameters:

Parameter Type Description
coords EditorViewCoords The y coordinate.

Returns: null | numberThe document position or null.


Official

Get the document position at the given screen coordinates with imprecise mode.

Signature:

posAtCoords(coords: EditorViewCoords, precise: false): number

Parameters:

Parameter Type Description
coords EditorViewCoords The y coordinate.
precise false Whether to require precise results.

Returns: numberThe document position.