Documentation / API Reference

Caret

is #

Arguments
element Node, Element, Dom
type StringType of check: start or end.

Checks the position of caret at the editable block.


let caret = this.app.create('caret');
let isEnd = caret.is(element, 'end');

set #

Arguments
element Node, Element, Dom
position StringPosition of the caret: start. end, before, after.

Sets the caret at the specified position.


let caret = this.app.create('caret');
caret.set(element, 'start');