New to Kendo UI for Angular? Start a free 30-day trial

Moving the Cursor of the Editor to the Beginning

Environment

ProductProgress® 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:

  1. 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.
    editor.view.state.selection.$cursor.pos = 0;
  1. Utilize the built-in focus method to focus the component.

    this.editor.focus();

The following example demonstrates how to position the cursor of the Editor at the beginning.

Example
View Source
Change Theme:

In this article

Not finding the help you need?