Skip to content

Commit

Permalink
Update anchor selection if split by patching style (#5087)
Browse files Browse the repository at this point in the history
  • Loading branch information
Piliuta authored Oct 18, 2023
1 parent a5fd386 commit 6d568d6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/lexical-selection/src/lexical-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ export function $patchStyleText(
// the entire first node isn't selected, so split it
firstNode = firstNode.splitText(startOffset)[1];
startOffset = 0;
anchor.set(firstNode.getKey(), startOffset, 'text');
}

$patchStyle(firstNode as TextNode, patch);
Expand Down

2 comments on commit 6d568d6

@vercel
Copy link

@vercel vercel bot commented on 6d568d6 Oct 18, 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-git-main-fbopensource.vercel.app
lexical-fbopensource.vercel.app
lexical.dev
lexicaljs.org
lexicaljs.com
www.lexical.dev

@vercel
Copy link

@vercel vercel bot commented on 6d568d6 Oct 18, 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-fbopensource.vercel.app
lexical-playground-git-main-fbopensource.vercel.app
lexical-playground.vercel.app
playground.lexical.dev

Please sign in to comment.