Table of Contents

Class CaretPosition

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The CaretPosition interface represents the caret position, an indicator for the text insertion point.
You can get a CaretPosition using the CaretPositionFromPoint(Number, Number, CaretPositionFromPointOptions) method.

[Value("CaretPosition")]
public class CaretPosition
Inheritance
CaretPosition
Inherited Members

Remarks

Constructors

CaretPosition()

public CaretPosition()

Properties

Offset

The offset property of the CaretPosition interface returns an integer representing the offset of the selection in the caret position node.

[Value("offset")]
public ulong Offset { get; }

Property Value

ulong

An integer.

Remarks

This will be the character offset in a text node or the selected child node's index in an element node.

-Node
-CaretPositionFromPoint(Number, Number, CaretPositionFromPointOptions)

See also on MDN

OffsetNode

The offsetNode property of the CaretPosition interface returns a Node containing the found node at the caret's position.

[Value("offsetNode")]
public Node OffsetNode { get; }

Property Value

Node

A Node.

Remarks

Methods

GetClientRect()

The getClientRect() method of the CaretPosition interface returns the client rectangle for the caret range.

[Value("getClientRect")]
public DOMRect? GetClientRect()

Returns

DOMRect

A DOMRect object.

Remarks