Repository navigation
[Breaking Changes][lexical][lexical-list][lexical-playground] Bug Fix: deleteCharacter through ListNode->ListItemNode - #7248
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
etrepum
marked this pull request as ready for review
February 25, 2025 17:38
etrepum
requested review from
Fetz,
Sahejkm,
acywatson,
fantactuka,
ivailop7,
potatowagon and
zurfyx
as code owners
February 25, 2025 17:38
etrepum
marked this pull request as draft
February 25, 2025 18:03
etrepum
marked this pull request as ready for review
February 25, 2025 20:27
zurfyx
approved these changes
Feb 25, 2025
etrepum
added a commit
to etrepum/lexical
that referenced
this pull request
Mar 1, 2025
Merged
This branch was successfully deployed
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.
Breaking Changes
As a follow-up to #7180 the collapseAtStart logic now continues through both inline and non-inline nodes so long as there are no previous siblings, roots, or shadow roots encountered. This is because nodes such as CollapsibleTitleNode had a collapseAtStart that returns true but contain nodes that are not inline and have a collapseAtStart that returns false (e.g. ParagraphNode).
In order to fix an inconsistency for how nested !isInline elements behave, CollapsibleContainerNode is now a shadowRoot. The CollapsibleContentNode was already a shadowRoot. This is now similar to the situation for tables where both TableNode and TableCellNode are both shadowRoot. The fix here also moved collapseAtStart from CollapsibleTitleNode to CollapsibleContainerNode which makes a bit more sense since the whole container gets collapsed, not just the title. The title is still the only location that you can initiate this collapse from, since it is always the first child.
Description
Fix deleteCharacter regression introduced in #7155 (v0.25.0). This new deleteCharacter implementation did not handle the scenario when a block element contained !isInline elements and no shadow roots were involved. The fix here changes the state machine to keep descending until a stop condition (shadowRoot or sibling caret) is met
Closes #7246
Test plan
Before
See #7246 for demo of regression
After
e2e test to reproduce regression and confirm fix