Skip to content

Commit

Permalink
Update packages/lexical/src/LexicalSelection.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Bob Ippolito <[email protected]>
  • Loading branch information
taro-shono and etrepum authored Oct 15, 2024
1 parent 8e7ffb1 commit 787b327
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/lexical/src/LexicalSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,7 @@ export class RangeSelection implements BaseSelection {
// extend the selection by one character in the specified direction.
// This ensures that the parent element is deleted along with its content.
// Otherwise, only the text content will be deleted, leaving an empty parent node.
if (this.anchor.offset === 0) {
if (this.isCollapsed() && this.anchor.offset === 0) {
this.modify('extend', isBackward, 'character');
}

Expand Down

0 comments on commit 787b327

Please sign in to comment.