Skip to content

Type Editor


Type Editor / @type-editor/tables / input/handle-key-down / handleKeyDown

Variable: handleKeyDown()

ts
const handleKeyDown: (view, event) => boolean;

Defined in: tables/src/input/handle-key-down.ts:36

Keydown handler for table-related keyboard shortcuts.

Handles the following key bindings:

  • Arrow keys: Navigate between cells.
  • Shift+Arrow keys: Extend cell selection.
  • Backspace/Delete: Delete selected cells' content.

Parameters

ParameterType
viewPmEditorView
eventKeyboardEvent

Returns

boolean

Example

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