Docs
Delete

Delete

Customize delete behavior for specific node types.

Features

  • Customizable delete behavior for different node types
  • Query-based node filtering
  • Selection handling on backspace
  • Integration with media and horizontal rule plugins

Installation

npm install @udecode/plate-select

Usage

import { DeletePlugin, SelectOnBackspacePlugin } from '@udecode/plate-select';
import { ImagePlugin } from '@udecode/plate-media';
import { HorizontalRulePlugin } from '@udecode/plate-horizontal-rule';
const plugins = [
  // ...otherPlugins,
  SelectOnBackspacePlugin.configure({
    options: {
      query: {
        allow: [ImagePlugin.key, HorizontalRulePlugin.key],
      },
    },
  }),
  DeletePlugin,
];

Plugins

DeletePlugin

Handles delete operations for specific node types.

Options

Collapse all

    Query options to filter which nodes the delete behavior applies to.

    • Default: { allow: ['p'] }

SelectOnBackspacePlugin

Handles selection behavior when pressing backspace.

Options

Collapse all

    Query options to determine which nodes trigger selection on backspace.