[lexical-list] Bug Fix: Write `li.value` only where the browser's count differs, so Enter near the top of a long list is not quadratic #9958
[vc]: #IBYkxFNOjqBq7f6kJjKytShXSmoFj75ULrWdmCCvO9A=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJsZXhpY2FsIiwicHJvamVjdElkIjoicHJqX01SYU1PMzFlRklrWTYxU0JxcVBEUjJPank4cVAiLCJ2MCI6ZmFsc2UsInJvb3REaXJlY3RvcnkiOiJwYWNrYWdlcy9sZXhpY2FsLXdlYnNpdGUiLCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vZmJvcGVuc291cmNlL2xleGljYWwvNTRjRFgxdUhlNHRweVhwMVhQUU5IUVcxYjYzeCIsInByZXZpZXdVcmwiOiJsZXhpY2FsLWdpdC1lbWlseWhvcnNtYW4tbGlzdC1pdGVtLXZhbHVlLWRvbS1mYm9wZW5zb3VyY2UudmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJERVBMT1lFRCJ9LHsibmFtZSI6ImxleGljYWwtcGxheWdyb3VuZCIsInByb2plY3RJZCI6InByal9lYTgydkxqNjg0WHpTUmRlTzdKU2QwUU5rYXdzIiwidjAiOmZhbHNlLCJyb290RGlyZWN0b3J5IjoicGFja2FnZXMvbGV4aWNhbC1wbGF5Z3JvdW5kIiwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL2Zib3BlbnNvdXJjZS9sZXhpY2FsLXBsYXlncm91bmQvRkVEdGRpc255VHFjamhrREJFbzgyWmlCTFdaRCIsInByZXZpZXdVcmwiOiJsZXhpY2FsLXBsYXlncm91bmQtZ2l0LWVtaWx5aG9yc21hbi1saXN0LWl0LWNmMTJiNi1mYm9wZW5zb3VyY2UudmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJERVBMT1lFRCJ9XSwicmVxdWVzdFJldmlld1VybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS92ZXJjZWwtYWdlbnQvcmVxdWVzdC1yZXZpZXc/b3duZXI9bWV0YSZyZXBvPWxleGljYWwmcHI9OTk1OCJ9
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated |
| :--- | :----- | :------ | :------ |
| <a href="https://vercel.com/fbopensource/lexical"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_MRaMO31eFIkY61SBqqPDR2Ojy8qP&teamId=team_QNIQyH5DJlqUjeCckcCcBEjE&s=32" width="16" height="16" align="middle" alt="" /></sup></a> lexical | !Ready Ready | Preview | <relative-time datetime="2026-11-23T02:45:14.682Z">Nov 23, 2026 2:45am UTC</relative-time> |
| <a href="https://vercel.com/fbopensource/lexical-playground"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_ea82vLj684XzSRdeO7JSd0QNkaws&teamId=team_QNIQyH5DJlqUjeCckcCcBEjE&s=32" width="16" height="16" align="middle" alt="" /></sup></a> lexical-playground | !Ready Ready | Preview | <relative-time datetime="2026-11-23T02:45:14.683Z">Nov 23, 2026 2:45am UTC</relative-time> |
<a href="https://vercel.com/vercel-agent/request-review?owner=meta&repo=lexical&pr=9958" rel="noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://agents-vade-review.vercel.sh/request-review-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://agents-vade-review.vercel.sh/request-review-light.svg"><img src="https://agents-vade-review.vercel.sh/request-review-light.svg" alt="Request Review"></picture></a>
AI review status for this pull request.
| Review status | Updated |
| :--- | :--- |
| 🟢 Reviewed (for maintainers only) | <relative-time datetime="2026-11-23T03:09:18Z">Nov 23, 2026, 3:09 AM UTC</relative-time> |
<!-- codebunny-status:1 r=318341089 p=9958 rv=2 -->
<details><summary><b>lexical</b></summary><p>
npm i https://pkg.pr.new/lexical@9958
</p></details>
<details><summary><b>@lexical/a11y</b></summary><p>
npm i https://pkg.pr.new/@lexical/a11y@9958
</p></details>
<details><summary><b>@lexical/clipboard</b></summary><p>
npm i https://pkg.pr.new/@lexical/clipboard@9958
</p></details>
<details><summary><b>@lexical/code</b></summary><p>
npm i https://pkg.pr.new/@lexical/code@9958
</p></details>
<details><summary><b>@lexical/code-core</b></summary><p>
npm i https://pkg.pr.new/@lexical/code-core@9958
</p></details>
<details><summary><b>@lexical/code-prism</b></summary><p>
npm i https://pkg.pr.new/@lexical/code-prism@9958
</p></details>
<details><summary><b>@lexical/code-shiki</b></summary><p>
npm i https://pkg.pr.new/@lexical/code-shiki@9958
</p></details>
<details><summary><b>@lexical/compiler</b></summary><p>
npm i https://pkg.pr.new/@lexical/compiler@9958
</p></details>
<details><summary><b>@lexical/devtools-core</b></summary><p>
npm i https://pkg.pr.new/@lexical/devtools-core@9958
</p></details>
<details><summary><b>@lexical/dragon</b></summary><p>
npm i https://pkg.pr.new/@lexical/dragon@9958
</p></details>
<details><summary><b>@lexical/eslint-plugin</b></summary><p>
npm i https://pkg.pr.new/@lexical/eslint-plugin@9958
</p></details>
<details><summary><b>@lexical/extension</b></summary><p>
npm i https://pkg.pr.new/@lexical/extension@9958
</p></details>
<details><summary><b>@lexical/fast-check</b></summary><p>
npm i https://pkg.pr.new/@lexical/fast-check@9958
</p></details>
<details><summary><b>@lexical/file</b></summary><p>
npm i https://pkg.pr.new/@lexical/file@9958
</p></details>
<details><summary><b>@lexical/hashtag</b></summary><p>
npm i https://pkg.pr.new/@lexical/hashtag@9958
</p></details>
<details><summary><b>@lexical/headless</b></summary><p>
npm i https://pkg.pr.new/@lexical/headless@9958
</p></details>
<details><summary><b>@lexical/history</b></summary><p>
npm i https://pkg.pr.new/@lexical/history@9958
</p></details>
<details><summary><b>@lexical/html</b></summary><p>
npm i https://pkg.pr.new/@lexical/html@9958
</p></details>
<details><summary><b>@lexical/internal</b></summary><p>
npm i https://pkg.pr.new/@lexical/internal@9958
</p></details>
<details><summary><b>@lexical/link</b></summary><p>
npm i https://pkg.pr.new/@lexical/link@9958
</p></details>
<details><summary><b>@lexical/list</b></summary><p>
npm i https://pkg.pr.new/@lexical/list@9958
</p></details>
<details><summary><b>@lexical/mark</b></summary><p>
npm i https://pkg.pr.new/@lexical/mark@9958
</p></details>
<details><summary><b>@lexical/markdown</b></summary><p>
npm i https://pkg.pr.new/@lexical/markdown@9958
</p></details>
<details><summary><b>@lexical/mdast</b></summary><p>
npm i https://pkg.pr.new/@lexical/mdast@9958
</p></details>
<details><summary><b>@lexical/offset</b></summary><p>
npm i https://pkg.pr.new/@lexical/offset@9958
</p></details>
<details><summary><b>@lexical/overflow</b></summary><p>
npm i https://pkg.pr.new/@lexical/overflow@9958
</p></details>
<details><summary><b>@lexical/plain-text</b></summary><p>
npm i https://pkg.pr.new/@lexical/plain-text@9958
</p></details>
<details><summary><b>@lexical/react</b></summary><p>
npm i https://pkg.pr.new/@lexical/react@9958
</p></details>
<details><summary><b>@lexical/rich-text</b></summary><p>
npm i https://pkg.pr.new/@lexical/rich-text@9958
</p></details>
<details><summary><b>@lexical/selection</b></summary><p>
npm i https://pkg.pr.new/@lexical/selection@9958
</p></details>
<details><summary><b>@lexical/table</b></summary><p>
npm i https://pkg.pr.new/@lexical/table@9958
</p></details>
<details><summary><b>@lexical/tailwind</b></summary><p>
npm i https://pkg.pr.new/@lexical/tailwind@9958
</p></details>
<details><summary><b>@lexical/text</b></summary><p>
npm i https://pkg.pr.new/@lexical/text@9958
</p></details>
<details><summary><b>@lexical/utils</b></summary><p>
npm i https://pkg.pr.new/@lexical/utils@9958
</p></details>
<details><summary><b>@lexical/y</b></summary><p>
npm i https://pkg.pr.new/@lexical/y@9958
</p></details>
<details><summary><b>@lexical/yjs</b></summary><p>
npm i https://pkg.pr.new/@lexical/yjs@9958
</p></details>
_commit: <a href="https://github.com/meta/lexical/runs/137455101733"><code>b3f345f</code></a>_
This number depends on the previous item's __value, but this function only runs when this item is reconciled. If the previous item becomes a wrapper (its text before the nested list is deleted) and an item is later inserted above it, updateChildrenListItemValue bumps the wrapper's value and leaves this item's unchanged, so this item is never reconciled and the browser draws it (and every later item) one too high. Repro: number list a, p + nested list, n, m; Backspace after p, then Enter after a: main draws 3. n, this branch 4. n. Marking the next sibling dirty when updateChildrenListItemValue changes a value fixes it locally; @lexical/yjs peers apply remote values with skipTransforms: true, so a reconcile-time check would cover them too.
Optional: because value is now set after createDOM has added the theme classes, exported HTML with a list item class changes from <li value="1" class="..."> to <li class="..." value="1">. Same numbers, but not byte-for-byte the same output the description calls unchanged; snapshot tests of exported HTML may notice.
Optional: the changelog takes only this file (.changeset/README.md), so consider adding that live items no longer carry value (li.value read from the editor is 0; li[value] and attr(value) CSS stop matching; use ListItemNode.getValue() or exportDOM), and that items hidden with display: none shift the numbers after them, next to the reversed caveat from the description.
Thanks for the careful write-up. The approach is sound, the speedup on long numbered lists is clear, and plain, nested, start and bullet/check lists still draw the same markers as before. Two things need to change before this can merge.
1. An item can keep a stale (missing) value and show the wrong number (packages/lexical-list/src/LexicalListItemNode.ts:979-993)
$updateListItemValueDOM decides an item's value from its previous sibling's __value, but it only runs when the item itself is reconciled. The description's correctness argument misses one case. The previous item turns into a wrapper (its first child becomes the nested list), and later its value goes up by one while the next item's value stays the same. updateChildrenListItemValue then calls setValue only on the wrapper, so the next item keeps a DOM computed for its old neighbour.
Steps, on a number list a, p (text, then a nested list), n, m: Backspace after p, then Enter at the end of a and type b. The model is a 1, b 2, (wrapper) 3, n 3, m 4. main draws 3. n and 4. m; this branch draws 4. n and 5. m, and the rest of the list stays off by one until something renumbers it. The list code keeps items that hold text beside a nested list (INTERNAL_$liftsFromStructure, $outdentFromItemWithContent), and the description lists that shape among the checked cases.
This test passes on main and fails on this branch:
test('the item after a new wrapper keeps its number', async () => {
const {editor} = testEnv;
await editor.update(() => {
const p = $createListItemNode().append(
$createTextNode('p'),
$createListNode('number').append($item('x')),
);
$getRoot().append(
$createListNode('number').append($item('a'), p, $item('n'), $item('m')),
);
});
await editor.update(() => {
// Delete "p": the item now only wraps the nested list.
const list = $getRoot().getFirstChildOrThrow() as ListNode;
(list.getChildAtIndex(1) as ListItemNode).getFirstChildOrThrow().remove();
});
await editor.update(() => {
// Enter at the end of "a".
const list = $getRoot().getFirstChildOrThrow() as ListNode;
list.getFirstChildOrThrow().insertAfter($item('b'));
});
// a, b, (wrapper 3), n 3, m 4: without a value, n is drawn as 4.
const items = editor.getRootElement()!.firstElementChild!.children;
expect(items[3].getAttribute('value')).toBe('3');
});
Marking the next sibling dirty in updateChildrenListItemValue whenever it changes an item's value makes that pass and keeps the @lexical/list unit tests green. Remote updates in @lexical/yjs are applied with skipTransforms: true (packages/lexical-yjs/src/SyncEditorStates.ts), though, so a receiving peer would not run that transform. A check at reconcile time would cover peers too. Please add the case as a regression test, with its Before and After output in the Test plan as AGENTS.md asks.
2. The browser test suite fails on stale expectations
core-tests / browser fails 20 tests that still expect value="N" on live items: packages/lexical-markdown/src/__tests__/browser/MarkdownShortcuts.test.ts and, under packages/lexical-playground/src/__tests__/browser/, ListsHTMLCopyAndPaste.test.ts, ListKeyboard.test.ts and LinksHTMLCopyAndPaste.test.ts. They need the same update as the unit and e2e specs.
Optional, non-blocking
.changeset/README.md), and its Verify: doesn't mention that live items no longer carry value. Consider a paragraph saying li.value read from the editor now reads 0 and li[value] or attr(value) CSS stops matching, pointing to ListItemNode.getValue() or exportDOM. Whether that counts as [breaking] under the README's definition is the maintainers' call.display: none is still counted by Lexical but not by the browser, so items after it now draw one lower than before. Worth a line next to the reversed caveat.exportDOM now emits <li class="..." value="1"> instead of <li value="1" class="...">. The numbers are the same, but "exportDOM unchanged" isn't byte-for-byte true, and snapshot tests of exported HTML may change.Automated review (maintainer link)
<!-- codebunny-pub:1 k=d891a246361c8f67beb0d0dfa3e3cab74f15e15d6ef983b01bc1de25fbc6d624 -->
Optional, but worth doing before merge: cdp() only works in Chromium. With VITEST_BROWSER=firefox all 50 tests in this file fail with browserContext.newCDPSession: CDP session is only available in Chromium, and .github/workflows/tests-extended.yml runs the browser suite on Firefox and WebKit once the PR is approved or labelled extended-tests. Gating the file, for example describe.runIf(server.browser === 'chromium') (as other browser tests branch on server.browser), keeps those jobs green.
Nit, optional: the first item's decision reads parent.getStart(), but ListNode.updateDOM only rewrites <ol start>, and the first item is not dirty when only __start changes. In an update with skipTransforms: true, list.setStart(5) on items 1 and 2 leaves the editor drawing 5 and 6 while the model shows 1 and 2 (main draws 1 and 2). The next transform-running edit converges, so it only affects code that skips transforms; re-deciding the first item when __start changes would mirror the updateDOM fix above.
The change looks good: numbered items keep the numbers they showed before, exported and copied HTML still carries value on every item, and the re-check in ListItemNode.updateDOM fixes the stale number after a renumbered wrapper (the new drawn-number tests fail against the first commit, in jsdom and on a collaborating peer, and pass on this head). The suggestions below are optional and non-blocking, though the first one is worth doing before merge.
1. Gate the new browser test on Chromium (packages/lexical-list/src/__tests__/browser/ListItemDrawnNumbers.test.ts:55). drawnMarkers reads the accessibility tree through cdp(), which Playwright only provides in Chromium. Run with VITEST_BROWSER=firefox, all 50 tests fail with browserContext.newCDPSession: CDP session is only available in Chromium. .github/workflows/tests-extended.yml runs the browser suite on Firefox and WebKit once a PR is approved or labelled extended-tests, so those jobs would go red here and on every later PR. AGENTS.md says the browser set comes from VITEST_BROWSER; other browser tests branch on server.browser (for example packages/lexical-playground/src/__tests__/browser/Hashtags.test.ts). Wrapping these cases in describe.runIf(server.browser === 'chromium') would fix it.
2. Nit: a start change made without the list transform. ListNode.updateDOM updates <ol start> but nothing re-decides the first item, which is not dirty when only __start changes. In an update with skipTransforms: true, list.setStart(5) on items numbered 1 and 2 leaves the editor drawing 5 and 6 while the model (and main) show 1 and 2. The next edit that runs the list transform converges, so this only matters for code that skips transforms. If you want the description's "the number the browser shows always equals __value" to hold there too, mirror the item-level fix when __start changes.
3. Nit: subclasses that export through createDOM. The export flag is private, so a ListItemNode subclass whose exportDOM calls this.createDOM(editor._config) instead of super.exportDOM(editor) now exports value only where the live count differs, and a partial copy that starts mid-list loses its numbers in other apps. One sentence in the changeset ("call super.exportDOM() to keep value on exported items") would cover it.
Thanks for the thorough before/after evidence and the mutation checks on the @lexical/y assertions.
Automated review (maintainer link)
<!-- codebunny-pub:1 k=ad203a6addaae8b29c74f2f74590ab33f56ec938f82ef1afccf30e7c4bf592da -->
Optional: this line (and :277) drops value from the pasted clipboard HTML, not only from the expected editor HTML. Import ignores value, so the test still passes, but Lexical's own exportDOM still writes value="1"/value="2" here, so keeping the original payload keeps this a faithful round trip (and matches the description's note that pasted inputs keep their values).
Optional: worth one sentence here (or in the description) that lists with many nested sublists keep most of the old cost: every item after a wrapper still needs value and is rewritten on each insert above it, since Lexical skips the wrapper in its count and the browser does not.
Optional: the flag is set only here, so a subclass that overrides exportDOM and builds its element with this.createDOM(editor._config) (as this method does) instead of calling super.exportDOM(editor) now exports without value on most items. A line in the changeset would help anyone with such a subclass.
This looks good to me. The rule in $updateListItemValueDOM is easy to follow, the export path keeps value exactly where it was, and the drawn-number cases (jsdom, a collaborating peer on v1 and v2, and Chromium's accessibility tree) make the guarantee concrete. The wrapper-renumber case from the earlier round is fixed by the updateDOM hook and pinned in all three tiers, and the CDP-based browser tests are now skipped outside Chromium.
Everything below is optional and non-blocking:
1. Transform-free setStart (packages/lexical-list/src/LexicalListItemNode.ts:1003, packages/lexical-list/src/LexicalListNode.ts:229-231). The first item is decided from parent.getStart(), but it is not reconciled when only __start changes. In an update with skipTransforms: true, list.setStart(5) on items a and b makes the editor draw 5 and 6 while the model still says 1 and 2 (main draws 1 and 2). Re-deciding the first ListItemNode child from ListNode.updateDOM when __start changes, the way updateDOM already re-decides the next item, would close this. A case for it in listEditCases.ts would keep it closed.
2. Checklist paste input (packages/lexical-playground/src/__tests__/browser/ListsHTMLCopyAndPaste.test.ts:243 and :277). These lines drop value from the pasted clipboard HTML, not only from the expected editor HTML. Import ignores value, so the test still passes, but Lexical's own exportDOM still writes value, so keeping the original payload keeps the test a faithful round trip. This also matches the description's note that pasted inputs keep their values.
3. Nested outlines (packages/lexical-list/src/LexicalListItemNode.ts:982-992). Every item after a wrapper still needs value, so a list with a sublist under most items still rewrites one value per wrapper below an insert and keeps most of the old cost. That is inherent while the model skips wrappers, and one sentence in the JSDoc or the description would set expectations.
4. Subclasses with their own exportDOM. The flag is set only inside ListItemNode.exportDOM, so a subclass that builds its export element with this.createDOM(...) instead of super.exportDOM(editor) now exports without value on most items. A line in the changeset would help anyone with such a subclass.
5. Changeset category. The entry follows the "Behavior changes" form in .changeset/README.md ([fix] with Verify:), which fits a DOM-output change. The README's table also calls a change [breaking] when "code that worked before has to change", and code reading li.value off the editor does. Either category is defensible, so this is a maintainer's call. If it becomes [breaking], it needs a Detect: line (reads of .value on editor <li>s, li[value], attr(value)).
Automated review (maintainer link)
<!-- codebunny-pub:1 k=a1594d1f9217295bb14d8161c268246cf00839d33b94888ec2e847ef38576543 -->
Approved these changes.
potatowagon
emilyhorsman
Description
At the moment
ListItemNode.updateDOM(throughcreateDOM) runsdom.value = this.__valueon every list item of every list type, bullet and check lists included. Inserting an item renumbers every item after it (updateChildrenListItemValue), so each later item is dirty and reconciled, and each one writesli.value. In our Chromium profiles, each of those writes makes the browser recompute the list's item ordinals, so an Enter near the top of an n-item list costs O(n²).In the playground on
main(headless Chromium, a pasted 4,000-item numbered list), one Enter at the end of item 1 takes:This PR makes an item write
valueonly where its number differs from the number the browser draws from the list's own count: the<ol start>for the first item, otherwise the previous item's number plus one. Every item still shows its__value.value. Anyvaluealready on one is removed.valueat all. The item after a nested list does get one: Lexical doesn't count the nested list's wrapper item, but the browser does.exportDOM. Exported and copied HTML still writesvalueon every item, so pasted lists number as before.__value, its previous sibling's__value, and the list's type andstart. Every renumbered item is dirty and reconciled, and inserting, removing or moving a sibling marks its neighbours dirty. The one remaining case is a previous item renumbered alone: an item that only wraps a nested list keeps the number of the item after it, so an insert above it renumbers the wrapper and not that item. For that,updateDOMre-decides the next item'svaluewhenever an item's__valuechanges. This also covers remote updates that@lexical/yjsapplies without the list transforms. So the number the browser shows always equals__value.Playground, same setup, with this change: the same Enter takes 143–151 ms at 1× and 599–632 ms at 4×. The markers Chromium draws (read from the accessibility tree) are identical before and after for:
start;This changes the rendered editor DOM.
valueon most items: live numbered list items no longer carryvaluewhere the browser already shows the right number, and bullet and check items carry none.li.valueoff the editor's DOM, rather than the model'sgetValue(), reads0for those items.li[value]or readattr(value)(for example custom multi-level numbering) no longer match most items.exportDOM), loses the numbers of a mid-list selection, since those items no longer carryvalue.ListNodehas noreversedsupport. A subclass or theme that adds<ol reversed>would need its own rule, since the browser counts down there. An item hidden withdisplay: noneis still counted by Lexical but not by the browser, so the items after it draw one lower.Updated tests:
value="N"is removed from live<li>s, except where the item still needs it (after a nested list):- unit:
lexical-listLexicalListItemNode.test.tsandLexicalListNode.test.ts;lexical-utilsLexicalEventHelpers.test.tsx;lexicalHTMLCopyAndPaste.test.ts,LexicalListPlugin.test.tsx,LexicalEditor.test.tsxandLexicalTabNode.test.tsx;lexical-selectionLexicalSelection.test.tsx;- playground e2e:
-
List,Indentation,Markdown,CharacterLimit,File,HorizontalRule,LinksandShadowDOMspecs;- in
ListsCopyAndPaste,ListsHTMLCopyAndPasteandCollaboration, only theassertHTMLexpectations, so pasted inputs keep theirvalues;- the regressions
3433-merge-markdown-listsand7246-delete-character-backward-list.@lexical/ychecks (__tests__/catalog/bind.ts,C1ReadEqualsFresh,C1Busy,ListValuesAfterRead):- These compared each rendered
li.valuewith the model's values. They now compare the number each numbered item shows (itsvalueattribute, else the list's own count) with the model.- They also assert that bullet and check items carry no
value.- They still fail when a rendered number differs from the model; see the mutation check below.
MarkdownShortcuts,ListKeyboard,ListsHTMLCopyAndPaste,LinksHTMLCopyAndPaste):value="N"is removed from live<li>s in the expected HTML, as in the jsdom tests. No matcher is loosened.-
packages/lexical-list/src/__tests__/unit/ListItemValueAttribute.test.ts: the attribute rule, plusexportDOMwritingvaluebefore the theme classes on every item of every list type.- Drawn numbers vs the model, across 24 edits (
packages/lexical-list/src/__tests__/unit/listEditCases.ts): wrappers, astartchange, a split, a merge, a move, indent and outdent, list type changes and pasted HTML. Each case runs after the edit, its undo and its redo, in three places:- jsdom (
ListItemDrawnNumbers.test.ts);- a collaborating peer, collab v1 and v2, including concurrent edits on both clients and a remote renumber while the peer has its own pending edit (
packages/lexical-react/src/__tests__/unit/CollaborationListNumbers.test.ts);- Chromium, reading each marker from the accessibility tree (
packages/lexical-list/src/__tests__/browser/ListItemDrawnNumbers.test.ts).Changeset
.changeset/list-item-value-attribute.md:pnpm run check-changesetspasses.Test plan
Before
Regression case (from review): a numbered list
a,p(text, then a nested listx),n,m. Deletep's text so the item only wraps the nested list, then insertbaftera. The model isa 1, b 2, (wrapper) 3, n 3, m 4.The same case also runs on a collaborating peer (collab v1 and v2) and in Chromium's accessibility tree. With the
updateDOMchange reverted, those fail too: the peer and the browser both draw4. nand5. m. With it, all of them pass. Onmain, every case in these files passes (mainwritesvalueon every item).After
Mutation check: the updated
@lexical/ychecks still catch a wrong rendered number.value:C1ReadEqualsFreshfails withrendered numbers [3,4,5,1,2,6,…] != [3,4,5,1,2,5,…](the item after a nested list), and the new unit test fails.valueon bullet items:C1ReadEqualsFreshfails withbullet or check items carry a value: ["1","2","3",…], and the new unit test fails.Not run: Firefox and WebKit (e2e and browser-mode unit tests), the collab and prod-build e2e variants, and the full e2e suite beyond the 13 specs above. The browser-mode unit suite (
pnpm run test-browser) ran in Chromium: 1,159 passed, 2 skipped.