Skip to content

Commit

Permalink
Fixed delete removing link node text when on linebreak (#5146)
Browse files Browse the repository at this point in the history
  • Loading branch information
9larsons authored Nov 16, 2023
1 parent 67a99e5 commit 7cf7990
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 @@ -1281,7 +1281,7 @@ export class RangeSelection implements BaseSelection {
lastNode = textNode;
}
// root node selections only select whole nodes, so no text splice is necessary
if (!$isRootNode(endPoint.getNode())) {
if (!$isRootNode(endPoint.getNode()) && endPoint.type === 'text') {
lastNode = (lastNode as TextNode).spliceText(0, endOffset, '');
}
markedNodeKeysForKeep.add(lastNode.__key);
Expand Down

2 comments on commit 7cf7990

@vercel
Copy link

@vercel vercel bot commented on 7cf7990 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical – ./packages/lexical-website

lexical.dev
lexical-git-main-fbopensource.vercel.app
lexicaljs.org
lexical-fbopensource.vercel.app
www.lexical.dev
lexicaljs.com

@vercel
Copy link

@vercel vercel bot commented on 7cf7990 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical-playground – ./packages/lexical-playground

lexical-playground-git-main-fbopensource.vercel.app
lexical-playground-fbopensource.vercel.app
playground.lexical.dev
lexical-playground.vercel.app

Please sign in to comment.