Repository navigation
[Breaking Changes][lexical] Bug Fix: Address deleteLine regression in #7248 - #7270
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
etrepum
marked this pull request as ready for review
March 2, 2025 20:19
etrepum
requested review from
Fetz,
Sahejkm,
acywatson,
fantactuka,
ivailop7,
potatowagon and
zurfyx
as code owners
March 2, 2025 20:19
Collaborator
Author
|
/cc @ivailop7 |
ivailop7
approved these changes
Mar 2, 2025
This was referenced Mar 3, 2025
Merged
etrepum
added a commit
to etrepum/lexical
that referenced
this pull request
Oct 3, 2026
## Description The decorator traversal removed for meta#9234 originated in meta#7270, which also fixed repeated forward deletion and deletion at image boundaries. Cover those cases directly with browser tests to guard against restoring the original regression. Exercise inline and inline-block image wrappers, private text, consecutive decorators, raised alignment, and repeated deletion across paragraph boundaries in rich and plain text. ## Test plan ### Before The existing full browser suite passed: 113 passed and 1 skipped files; 1115 passed and 7 skipped tests. The image and repeated-deletion cases added here were not covered by that focused browser fixture. ### After VITEST_BROWSER=chromium,firefox,webkit pnpm test-browser --config vitest.9234.config.mts InlineDecoratorLineDeletion.test.ts --no-file-parallelism 3 test files passed; 420 tests passed across Chromium, Firefox, and WebKit on Linux. The local config only overrides Chromium's executable path. pnpm run tsc-test, ESLint and Prettier for the changed test, and git diff --check passed.
This was referenced Oct 3, 2026
Closed
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
To handle platform differences and avoid piercing shadow roots, arrow key navigation for RangeSelection is now handled by lexical in more scenarios when crossing the boundaries of elements. This should only affect "exotic" custom element nodes such as TableNode. All code in @lexical/table has been updated accordingly, but if you have something like a custom table implementation then it may require additional updates (probably in the direction of removing workarounds rather than adding them).
Description
Address deleteLine regression in #7248. The selection movement code had some logic errors and adding carets to the mix (which validate text offsets) messed it up. This fixes the problem mostly by improving RangeSelection.modify.
It now:
After fixing these issues, some of the TableNode selection code had to change as well, since it was dependent on the browsers doing weird things across shadow roots and fixing things up afterwards. Once that was cleaned up it also fixed some Firefox and table wrapper discrepancies (resulting in fewer test workarounds and skips). Note that I focused the scope of this specifically on left/right arrow keys for tables, up/down navigation should work as it did before.
Closes #7267
Test plan
All existing e2e tests pass, plus additional test coverage for forward deletion which had no coverage previously.