Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Numbered List Resets After Page Break in Lexical Editor #7032

Open
PatrickAfshar opened this issue Jan 9, 2025 · 0 comments
Open

Bug: Numbered List Resets After Page Break in Lexical Editor #7032

PatrickAfshar opened this issue Jan 9, 2025 · 0 comments

Comments

@PatrickAfshar
Copy link

Lexical version: 0.22.0

When using the lexical-list plugin in a Lexical Editor to create nested numbered lists, adding a page break resets the numbering of the list to 1. This disrupts the continuity of numbered lists and affects the user experience, particularly when working with structured or formatted content.
Steps to Reproduce:
Add the lexical-list plugin to a Lexical Editor instance.
Create a numbered list with multiple items.
Insert a page break in the middle of the list.
Continue the list after the page break.
Observe that the numbering resets to 1 instead of continuing from the previous number.
Expected Behavior:
Numbered lists should retain their numbering across a page break, ensuring continuity in the sequence.
Actual Behavior:
The numbering of the list resets to 1 after a page break, disrupting the expected sequence.
Suggested Solution:
Implement a custom PageBreakNode that integrates into the Lexical Editor without disrupting the list numbering.
Define a new PageBreakNode class to represent page breaks in the Lexical state.
Ensure the PageBreakNode doesn't interrupt the context of the list plugin.
Modify the lexical-list plugin to:
Skip over PageBreakNode when calculating numbering.
Maintain the correct list numbering across sections divided by page breaks.
Add test cases for:
Numbered lists with a single page break.
Nested lists with page breaks.
Multiple page breaks in a single editor instance.
Environment:
Lexical Version: [Specify your version]
Browser: [Specify browser and version]
Operating System: [Specify OS and version]
Additional Context:
This issue is relevant for scenarios where users need structured numbering, such as creating documents or outlines. A seamless solution will enhance the usability of the lexical-list plugin in content-heavy applications.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant