-
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-table] Bug: Table formatting and styling not persisting for empty cells #6626
[lexical-table] Bug: Table formatting and styling not persisting for empty cells #6626
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
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.
LGTM, @etrepum for a second pair of eyes
selectedNodes.forEach((node) => { | ||
if ($isParagraphNode(node)) { | ||
const newFormat = node.getFormatFlags(formatType, null); | ||
node.setTextFormat(newFormat); | ||
} | ||
}); |
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.
We should implement alignment with the first cell of the selection. When the text/paragraphs have mixed formatting toggling bold should change the entire selection to have the same setting for bold.
Screen.Recording.2024-09-12.at.11.49.27.mov
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.
@@ -357,7 +357,7 @@ export class TableObserver { | |||
const focus = formatSelection.focus; | |||
|
|||
selection.getNodes().forEach((cellNode) => { |
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.
I think this is where we would have to capture the format alignment
Aligns format between different cells of the table for tableSelection. Get the format for the first cell and pass it to formatText function to allign all the next cells with it.
…the first TextNode
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.
Looks great, thank you!
Description
Apply format change to empty paragraphs. Before it was only applied to text nodes
Closes #6583
Test plan
Before
Formatting is not applied to empty paragraphs
After
Formatting is applied to empty paragraphs