Overview

The Caret component creates a custom caret and moves the position to the focus boundary of the native selection. This component is able to generate sub carets, but currently only the primary caret is in use.

This component is not compatible with IE since there is no way to disable the native caret.

Caret Methods

register()

register( id: string ): CustomCaret

Registers a new caret.

Params

id

The ID for the caret to register.

Return

The registered CustomCaret instance.


get()

get( id: string ): CustomCaret

Returns the primary or the specific CustomCaret instance.

Params

id

Optional. A caret ID.

Return

A CustomCaret instance if available, or otherwise undefined.

CustomCaret

move()

move( position: Position ): void

Moves the caret to the specified position.

Params

position

A position to set as [ row, col ].


show()

show(): void

Displays the caret.


hide()

hide(): void

Hides the caret.