Docs
Delete
Delete
Customize delete behavior for specific node types.
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
- Default:
{ allow: ['p'] }
Query options to filter which nodes the delete behavior applies to.
SelectOnBackspacePlugin
Handles selection behavior when pressing backspace.
Options
Collapse all
Query options to determine which nodes trigger selection on backspace.