Skip to content

Feature: Support multiple editors to single LexicalComposer #1863

Description

@ecumene

Multiple Editors

I would like to have pages in my editor, similar to Microsoft Word or Google Docs where each page has a blank space between them. I've tried doing the hacks other people have described via content-editable but they don't really work because you can delete the page break.

My use case is that I want to make a WYSIWYG editor for PDF / docx, but I can't seem to find a way to put that heard break in there. I may just resort to adding "page indicators" that tell you where a page ends based on height by drawing a line.

Editor

<LexicalComposer>
  <ToolbarPlugin />
  <Page />
  <Page />
  <Page />
</LexicalComposer>

Page

return (
  <LexicalOnChangePlugin onChange={onChange} />
);

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

Perhaps I'm going about the above wrong? Should I instead have multiple LexicalComposers and index them somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement over existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions