Skip to content

Type Editor


Type Editor / @type-editor/tables / input/handle-paste

input/handle-paste

Functions

FunctionDescription

handlePaste

Handles paste events within table cells.

This function handles two scenarios:

  1. When pasting into a cell selection, it clips the pasted content to fit the selected area and inserts cells appropriately.
  2. When pasting table-like content into a single cell, it expands the table if necessary to accommodate the pasted cells.

Example

typescript
// Use in a ProseMirror plugin
new Plugin({
  props: {
    handlePaste: handlePaste,
  },
});