Skip to content

Type Editor


Type Editor / @type-editor/dom-change-util / parse-change/looks-like-backspace-key

parse-change/looks-like-backspace-key

Functions

FunctionDescription

looksLikeBackspaceKey

Checks if the change looks like the effect of pressing the Backspace key.

Similar to Enter detection, some backspace operations (especially block joins) are better handled through the Backspace key handler. This function detects if a change looks like a backspace operation by checking:

  • The selection anchor is after the change start (backspacing backwards)
  • The change matches the backspace pattern (see looksLikeBackspace)
  • A handleKeyDown plugin accepts the Backspace key event

The detailed backspace detection logic is in the looksLikeBackspace function.

See

looksLikeBackspace for detailed backspace detection logic