Skip to content

Commit

Permalink
[lexical-playground] Bug Fix: Ensure Delete Node handles all node typ…
Browse files Browse the repository at this point in the history
…es (#7096)

Co-authored-by: shaheerkpzaigo <mohammedshaheer@zaigoinfotech.com>
  • Loading branch information
mshaheerz and shaheerkpzaigo authored Jan 28, 2025
1 parent 8e2ede2 commit 3a140d2
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {
import {
$getNearestNodeFromDOMNode,
$getSelection,
$isDecoratorNode,
$isNodeSelection,
$isRangeSelection,
COPY_COMMAND,
CUT_COMMAND,
Expand Down Expand Up @@ -183,6 +185,13 @@ export default function ContextMenuPlugin(): JSX.Element {
.at(-2);

ancestorNodeWithRootAsParent?.remove();
} else if ($isNodeSelection(selection)) {
const selectedNodes = selection.getNodes();
selectedNodes.forEach((node) => {
if ($isDecoratorNode(node)) {
node.remove();
}
});
}
},
}),
Expand Down

0 comments on commit 3a140d2

Please sign in to comment.