Skip to content

Question: Inserting a New Line. #3423

Answered by zignis
nrikiji asked this question in Q&A
Discussion options

You must be logged in to vote

@zignis Thanks for the reply. Is it like adding a node by handling the enter key around the following?

editor.registerUpdateListener(({ editorState }) => {
    ・・・
});
・・・
editor.update(() => {
    ・・・
});

Yes, you may want to take a look at how the @lexical/code package does it: https://github.com/facebook/lexical/blob/main/packages/lexical-code/src/CodeHighlighter.ts#L515

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@nrikiji
Comment options

Answer selected by thegreatercurve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement Improvement over existing feature
3 participants
Converted from issue

This discussion was converted from issue #3366 on November 25, 2022 11:58.