[Beta]: In the DOM Coverage Boundaries example, Select all and Copy give different, malformed text with sections collapsed and expanded
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- playwright, react, typescript
Direzione di ricerca
Start with the reproduction and the copy flow in apps/www/src/app/(app)/examples/plite/_examples/dom-coverage-boundaries.tsx and packages/plitejs/src/dom/plugin/dom-clipboard-runtime.ts; the report points to writeSelection and distinguishes the model and DOM paths. Compare the payloads with sections collapsed and expanded, then check existing clipboard tests for coverage. Done means Select all yields consistent block text without section labels or internal editor attributes in either state.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Testing lane
- Repository:
udecode/plate - Branch:
next - Release channel: Beta
- Exact commit/package version:
NOT_ENOUGH_INFO
Summary
On /examples/plite/dom-coverage-boundaries, the page's Copy button gives a different payload for Select all when the sections are collapsed than when they are expanded, and both versions are malformed. Collapsed, the text of the collapsed sections runs together on one line in text/plain, and text/html is one <span> around the same text. Expanded, text/plain has no line break after the header, includes the section labels Outer section, Nested section and Deep section and extra blank lines, and text/html is the editor's own DOM with internal attributes.
Reproduction
Repro 1: /examples/plite/dom-coverage-boundaries, Chromium
The buttons are in the row under the page title: Header, Outer, Nested, Deep, Footer, Update hidden body, Select hidden body, Select all and Copy. The copy box is the box at the bottom of the page that shows text/plain: and text/html:.
- Open https://beta.platejs.org/examples/plite/dom-coverage-boundaries. On a fresh page the header, the footer and the sections are hidden.
- Click
Select all. - Click
Copyand scroll to the copy box. - Scroll up and click
Header,Footer,Outer,NestedandDeep, so everything shows. - Click
Select all, thenCopy, and look at the copy box again.
After step 3, text/plain reads:
Visible introduction before the collapsed section.
Section summary stays mounted.Hidden alphaNested summary stays mounted.Nested hidden bodyDeep summary stays mounted.Deep hidden bodyHidden list item
Visible paragraph after the collapsed section.
text/html is a single <span> with data-editor-fragment attributes around the same text.
After step 5, text/plain reads:
Hidden header textVisible introduction before the collapsed section.
Outer section
Section summary stays mounted.
Hidden alpha
Nested section
Nested summary stays mounted.
Nested hidden body
Deep section
Deep summary stays mounted.
Deep hidden body
Hidden list item
Visible paragraph after the collapsed section.
Hidden footer text
text/html starts with <span data-editor-text-flow="true" data-editor-node="text" ...> and carries attributes such as data-editor-node-key, data-editor-path and data-editor-text-flow-reconcile-ms on its nodes. The Outer section label comes in as <div class="editor-dom-coverage-summary" contenteditable="false">Outer section</div>.
Expected
This page has no Slate reference. As the tester (natamox) expects: apart from the header and footer, which are left out by design while they are hidden, Select all copies the same text whether the sections are collapsed or expanded. Each block is on its own line, the section labels are not part of the text, and text/html holds no internal editor attributes.
Actual
Collapsed, the collapsed sections' blocks run together on one line, and text/html is one <span>. Expanded, the header runs into the next line, the three section labels and extra blank lines are added, and text/html is the editor's DOM with its internal attributes.
Environment
- Exact
nextcommit/Beta package version:NOT_ENOUGH_INFO. The recording's step panel names the build as Beta, next7f2eacb6eb, deployed 2026-10-22. - Repro 1: headless Chromium 149.0.7827.55 on macOS, driven by Playwright. An agent recorded it at natamox's request on 2026-10-22 (PT). natamox judged it low priority.
- The page's
Copybutton only shows the payload on the page. It does not write the system clipboard, and nobody checked a real ⌘C or pasted the payload anywhere. - Nobody has tried another browser.
Caveat
- Nobody has traced the cause. From a reading of the code on
next, theCopybutton (apps/www/src/app/(app)/examples/plite/_examples/dom-coverage-boundaries.tsx:193) callseditor.api.dom.clipboard.writeSelection, the same entry point the editor's copy handler uses. When the range covers a boundary with a copy policy, such as a collapsed section,packages/plitejs/src/dom/plugin/dom-clipboard-runtime.ts:548writes the payload from the document model. With everything expanded there is no such boundary, and:576clones the page's DOM, which would bring in the section labels and the internal attributes. Both paths are read from the code. That the model path joins blocks without line breaks is read from the result, not traced. - Leaving out the hidden header and footer while they are hidden is by design: a fully hidden boundary defaults to
copyPolicy = 'exclude'(packages/plitejs/src/react/components/dom-coverage-boundary.tsx:152), and a collapsed section's boundary defaults to'model'(:37). - #5263 goes through the same copy function with a different failure: there nothing is written to the clipboard.
Evidence
- Repro 1: headless Chromium recording, 36 seconds, with an English step panel beside the page. At 0:00
Select allis clicked. At 0:04Copyis clicked, and from 0:05 the copy box shows the collapsed payload with the run-together line and the one-<span>HTML. From 0:08 the page scrolls up and the five buttons are clicked. At 0:15Select allis clicked again, and at 0:19Copy. From 0:20 the copy box showsHidden header textVisible introduction…, the three section labels, the blank lines and the HTML withdata-editor-*attributes. From 0:26 the panel shows the result to the end.
Repro 1 — Chromium, /examples/plite/dom-coverage-boundaries
https://github.com/user-attachments/assets/3fdd2b38-4a28-4fca-be35-5b708cdaaae9
- Lingua principale
- TypeScript
- Stelle
- 16.6k
- Fork
- 993
- Merge medio
- 20h 1m
- PR unite (30g)
- 60
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di udecode/plate
-
bug target:beta triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
bug plugin:link target:beta triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug mobile target:beta triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug target:beta triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
bug target:beta triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di udecode/plate
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Merit-Systems/x402scan#1312 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Native Web
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
digitalfabrik/integreat-app#4517 ·
I maintainer di solito rispondono entro 2 giorni
-
TLS guide repeats certs/ in the certificate directoryForse già presa @maheshrijal l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
prometheus/docs#3156 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
medusajs/dtc-starter#90 ·
I maintainer di solito rispondono entro 1 giorno