Skip to content

Commit

Permalink
Ensure new paragraph node retains selection styling when exiting list
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Lapuskin committed Dec 6, 2024
1 parent 97481c9 commit 09f76ce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/lexical-list/src/formatList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,8 @@ export function $handleListInsertParagraph(): boolean {

if ($isRootOrShadowRoot(grandparent)) {
replacementNode = $createParagraphNode();
replacementNode.setTextStyle(selection.style);
replacementNode.setTextFormat(selection.format);
topListNode.insertAfter(replacementNode);
} else if ($isListItemNode(grandparent)) {
replacementNode = $createListItemNode();
Expand Down

0 comments on commit 09f76ce

Please sign in to comment.