Selection commands

The Tiptap editor provides editor commands for managing selection and focus within your documents. Here’s an overview of the essential selection commands that help you manage cursor movement, selections, and focus behavior.

Use Cases

List of selection commands

CommandDescription
blurRemoves focus from the editor.
deleteRangeDeletes everything in a range.
deleteSelectionDeletes the current selection or cursor position.
enterSimulates an Enter key press, creating a new line.
focusSets focus back to the editor and moves the cursor to a specified position.
keyboardShortcutTriggers a ShortcutEvent with a given name.
scrollIntoViewScrolls the view to the current selection or cursor position.
selectAllSelects the entire document.
selectNodeBackwardSelects the node before the current textblock if the cursor is at the start of a textblock.
selectNodeForwardSelects the node after the current textblock if the cursor is at the end of a textblock.
selectParentNodeMoves the selection to the parent node of the currently selected node.
setNodeSelectionCreates a new NodeSelection at a given position.
setTextSelectionControls the text selection by setting it to a specified range or position.