[Lexical-list] Bug Fix : Exit list on delete for empty non-first list items#8314
Closed
Jynx2004 wants to merge 50 commits into
Closed
[Lexical-list] Bug Fix : Exit list on delete for empty non-first list items#8314Jynx2004 wants to merge 50 commits into
Jynx2004 wants to merge 50 commits into
Conversation
…into format_issue_fix
…into format_issue_fix
Co-authored-by: Bob Ippolito <bob@redivi.com>
Co-authored-by: Bob Ippolito <bob@redivi.com>
Co-authored-by: Bob Ippolito <bob@redivi.com>
etrepum
reviewed
Apr 12, 2026
etrepum
reviewed
Apr 21, 2026
Comment on lines
+262
to
+286
| function listNodeHasOverflow( | ||
| editor: LexicalEditor, | ||
| listNode: ListNode, | ||
| ): boolean { | ||
| const overflowConfig = editor._nodes.get('overflow'); | ||
| if (!overflowConfig) { | ||
| return false; | ||
| } | ||
| const overflowKlass = overflowConfig.klass; | ||
| const stack: Array<LexicalNode> = [listNode]; | ||
| while (stack.length > 0) { | ||
| const node = stack.pop()!; | ||
| if (node instanceof overflowKlass) { | ||
| return true; | ||
| } | ||
| if ($isElementNode(node)) { | ||
| let child = (node as ElementNode).getLastChild(); | ||
| while (child !== null) { | ||
| stack.push(child); | ||
| child = child.getPreviousSibling(); | ||
| } | ||
| } | ||
| } | ||
| return false; | ||
| } |
Collaborator
There was a problem hiding this comment.
This is still not acceptable for list to depend on overflow implementation details
Collaborator
|
Closing due to inactivity, re-open or create a new PR when/if you intend to continue working on this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements the standard word processor behavior (Microsoft Word, Google Docs) where pressing Delete on an empty non-first list item exits the list and creates a new paragraph block.
Changes
DELETE_CHARACTER_COMMANDhandler inregisterList()that:COMMAND_PRIORITY_LOWto not interfere with other delete handlersBehavior
Before: Empty list item would remain in the list
After: Pressing Delete on an empty non-first list item exits the list and creates a paragraph
Closes #7577
Test plan