Skip to content

Type Editor


Type Editor / @type-editor/dom-change-util / parse-change/handle-selection-only-change

parse-change/handle-selection-only-change

Functions

FunctionDescription

handleSelectionOnlyChange

Handles selection-only changes (when no content has changed).

This function is called when a DOM change event indicates a selection change but no content modification. It reads the current DOM selection, creates a transaction to update the editor selection, and dispatches it.

The function also:

  • Determines the selection origin (pointer, key, or null) based on timing
  • Handles Android Chrome Enter key edge cases
  • Adds appropriate metadata to the transaction (pointer, scrollIntoView, composition)

If the new selection is identical to the current selection, no action is taken.

See