You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to insert a line that preserves the status of the previous line when a new line is inserted with the enter key? If you have a sample code, could you please let me know?
That is not the behavior in Lexical's Playground. Also, the Draft.js demo has that behavior.
Is it possible to insert a line that preserves the status of the previous line when a new line is inserted with the enter key? If you have a sample code, could you please let me know?
That is not the behavior in Lexical's Playground. Also, the Draft.js demo has that behavior.
You can try line break node or $createTextNode with $createParagraphNode (kind of hack):
Is it possible to insert a line that preserves the status of the previous line when a new line is inserted with the enter key? If you have a sample code, could you please let me know?
That is not the behavior in Lexical's Playground. Also, the Draft.js demo has that behavior.
When you say "preserves the status" what do you mean, exactly?
Activity
zignis commentedon Nov 21, 2022
You can try line break node or
$createTextNodewith$createParagraphNode(kind of hack):acywatson commentedon Nov 23, 2022
When you say "preserves the status" what do you mean, exactly?
nrikiji commentedon Nov 23, 2022
@zignis
Thanks for the reply. Is it like adding a node by handling the enter key around the following?
nrikiji commentedon Nov 23, 2022
@acywatson
Thanks for the reply. For example, we want to continue the selected font size and color in the next line.
zignis commentedon Nov 23, 2022
Yes, you may want to take a look at how the
@lexical/codepackage does it: https://github.com/facebook/lexical/blob/main/packages/lexical-code/src/CodeHighlighter.ts#L515