Skip to content

Type Editor


Type Editor / @type-editor/selection-util / sync-node-selection / syncNodeSelection

Function: syncNodeSelection()

ts
function syncNodeSelection(view, sel): void;

Defined in: sync-node-selection.ts:15

Synchronizes node selection state between ProseMirror and the DOM.

When a node is selected (as opposed to text selection), this function ensures that the appropriate view descriptor is marked as selected, and any previously selected node is deselected. This allows node views to apply custom styling or behavior when selected.

Parameters

ParameterTypeDescription
viewPmEditorViewThe editor view
selPmSelectionThe current ProseMirror selection

Returns

void