New to Kendo UI for Angular? Start a free 30-day trial
Moving the Cursor of the Editor to the Beginning
Environment
Product | Progress® Kendo UI® for Angular Editor |
Description
How to move the cursor of the Editor to the beginning?
Solution
The Editor view
exposes the ProseMirror EditorView instance and thus provides access to the current Editor state and selection.
To move the position of the cursor to the beginning of the Editor:
-
Use the selecion $cursor that returns a resolved position and set the value of its position property to 0 in order to move the position of the Editor's cursor to the beginning.
tseditor.view.state.selection.$cursor.pos = 0;
-
Utilize the
focus
method of the ProseMirror library to focus the component.tseditor.view.focus();
Prior to
v16.3.0
of the Editor package, use built-infocus
method to focus the component.
The following example demonstrates how to position the cursor of the Editor at the beginning.
Change Theme
Theme
Loading ...