Skip to content

Type Editor


Type Editor / @type-editor/selection-util / selection-to-dom

selection-to-dom

Functions

FunctionDescription

selectionToDOM

Synchronizes the ProseMirror selection to the DOM.

This function updates the browser's selection to match the current ProseMirror selection state. It handles various edge cases including:

  • Node selections
  • Delayed drag selections in Chrome
  • Broken selection behavior in Safari/older Chrome
  • Cursor wrappers for special cases
  • Selection visibility