Skip to content

Feature: Support multiple editors to single LexicalComposer #1866

Answered by zurfyx
ecumene asked this question in Q&A
Discussion options

You must be logged in to vote

On top of my head, I'd probably approach the problem with a transform rather than via hardcoded pages. See the CharacterLimit plugin for instance (https://github.com/facebook/lexical/blob/main/packages/lexical-react/src/shared/useCharacterLimit.js#L126). What it does is to calculate how much content it can fit and otherwise wrap the rest elsewhere.

For pages, it'd be rect sizes instead but the idea is similar. And you'd have to handle the special hard page break case.

The above works, but onChange only gets called for the last page.

To answer the question specifically, onChange does listen to all LexicalComposer EditorState changes but if Page is a DecoratorNode you'll have to propagate…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ecumene
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
2 participants
Converted from issue

This discussion was converted from issue #1863 on April 19, 2022 08:56.