We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e2ede2 commit 3a140d2Copy full SHA for 3a140d2
packages/lexical-playground/src/plugins/ContextMenuPlugin/index.tsx
@@ -17,6 +17,8 @@ import {
17
import {
18
$getNearestNodeFromDOMNode,
19
$getSelection,
20
+ $isDecoratorNode,
21
+ $isNodeSelection,
22
$isRangeSelection,
23
COPY_COMMAND,
24
CUT_COMMAND,
@@ -183,6 +185,13 @@ export default function ContextMenuPlugin(): JSX.Element {
183
185
.at(-2);
184
186
187
ancestorNodeWithRootAsParent?.remove();
188
+ } else if ($isNodeSelection(selection)) {
189
+ const selectedNodes = selection.getNodes();
190
+ selectedNodes.forEach((node) => {
191
+ if ($isDecoratorNode(node)) {
192
+ node.remove();
193
+ }
194
+ });
195
}
196
},
197
}),
0 commit comments