Skip to content

[lexical-list] Chore: Remove redundant decorator-adjacent backspace handler - #8871

Merged
etrepum merged 1 commit into
meta:mainfrom
mayrang:chore/remove-decorator-backspace-handler
Jul 22, 2026
Merged

etrepum merged 1 commit into
meta:mainfrom
mayrang:chore/remove-decorator-backspace-handler

Conversation

@mayrang

@mayrang mayrang commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Description

$handleListItemBackspaceAdjacentToDecorator was added by PR #8676 (issue #5072) to prevent Backspace at the start of a list item from deleting an adjacent DecoratorNode above it. It converted the first list item into a paragraph instead.

Since PR #8829, ListItemNode.collapseAtStart() handles all first-item Backspace cases — including the decorator-adjacent one — by converting to paragraph. Both paths produce the same tree structure, making the decorator handler dead code.

Test plan

  • pnpm test-unit -- packages/lexical-list — 119 tests pass, 0 regressions
    • All 12 tests in registerListBackspaceDecorator.test.ts pass via collapseAtStart
  • e2e (chromium) — 771 pass
  • tsc clean

@vercel

vercel Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview Jul 22, 2026 3:09am
lexical-playground Ready Ready Preview Jul 22, 2026 3:09am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 22, 2026
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Jul 22, 2026
@etrepum
etrepum added this pull request to the merge queue Jul 22, 2026
Merged via the queue into meta:main with commit 82613ad Jul 22, 2026
48 checks passed
@etrepum etrepum mentioned this pull request Jul 29, 2026
etrepum pushed a commit to etrepum/lexical that referenced this pull request Aug 6, 2026
Conflicts resolved:
- formatList.ts: compose upstream's named-slot guard (meta#8905) with this
  branch's $copySemanticNestingMark — the mark copy now happens inside the
  slot-host check, alongside the children move it annotates.
- registerList.ts: accept upstream's removal of the decorator-adjacent
  backspace handler (meta#8871); the semantic parking that handler carried
  lives in ListItemNode.collapseAtStart, which the core deleteCharacter
  path invokes, and registerListBackspaceDecorator.test.ts still passes.
  Drop the now-unused $parkNestedListsInWrapper import here.

Also align this branch's ARROW_RIGHT registration with upstream's
registerCommand generics removal (meta#8877 follow-up, meta#8871 series).

Verified: tsc clean; 872 list/markdown/mdast unit tests, 51 browser tests,
and 4267 core/react/html/selection/rich-text tests pass.

Co-Authored-By: Claude Fable 5 <[email protected]>

This branch was successfully deployed

2 active deployments
Preview – lexical — 1ad6810e Deployed Jul 22, 2026 by vercel[bot]
Preview – lexical-playground — 1ad6810e Deployed Jul 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants