Skip to content

Commit

Permalink
style: adjust the code execution order
Browse files Browse the repository at this point in the history
  • Loading branch information
keiseiTi committed Sep 6, 2024
1 parent 232230c commit 8531443
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/lexical/src/LexicalSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1703,11 +1703,12 @@ export class RangeSelection implements BaseSelection {
if (this.forwardDeletion(anchor, anchorNode, isBackward)) {
return;
}
if ($isElementNode(anchorNode)) {
const childNode = anchorNode.getChildAtIndex(0);
if ($isDecoratorNode(childNode) && anchor.offset === 0) {
return;
}
if (
anchor.offset === 0 &&
$isElementNode(anchorNode) &&
$isDecoratorNode(anchorNode.getFirstChild())
) {
return;
}
// Handle the deletion around decorators.
const focus = this.focus;
Expand Down

0 comments on commit 8531443

Please sign in to comment.