-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lexical-rich-text] Bug Fix: HeadingNode.insertNewAfter #6435
[lexical-rich-text] Bug Fix: HeadingNode.insertNewAfter #6435
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
Before and After: https://www.loom.com/share/522f8f3bd808464bb07c7019c3abdf36 |
i can reproduce the issue, had to create multiple text nodes in heading, eg. bold "Hello" in "Hello world" |
headingNode = new HeadingNode('h1'); | ||
const headingTextNode1 = $createTextNode('hello'); | ||
const headingTextNode2 = $createTextNode(' world'); | ||
headingTextNode2.setFormat('bold'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the fix!
Description
If a paragraph is inserted when the selection is at the end of a heading, a paragraph should be inserted.
However, the logic for detecting whether the selection was at the end of the heading was incorrect. It did not work if, for example, the heading had multiple TextNodes.