Skip to content

Commit

Permalink
fix Heading.insertNewAfter (#5198)
Browse files Browse the repository at this point in the history
Co-authored-by: EgonBolton <[email protected]>
  • Loading branch information
GermanJablo and GermanJablo authored Nov 3, 2023
1 parent 55bb444 commit ed8f85f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/lexical-rich-text/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ export class HeadingNode extends ElementNode {
newElement.setDirection(direction);
this.insertAfter(newElement, restoreSelection);
if (anchorOffet === 0 && !this.isEmpty() && selection) {
this.replace($createParagraphNode(), restoreSelection);
const paragraph = $createParagraphNode();
paragraph.select();
this.replace(paragraph, true);
}
return newElement;
}
Expand Down

2 comments on commit ed8f85f

@vercel
Copy link

@vercel vercel bot commented on ed8f85f Nov 3, 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
lexical-fbopensource.vercel.app
lexicaljs.com
lexicaljs.org
www.lexical.dev

@vercel
Copy link

@vercel vercel bot commented on ed8f85f Nov 3, 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
playground.lexical.dev
lexical-playground.vercel.app
lexical-playground-fbopensource.vercel.app

Please sign in to comment.