Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Beta]: In the Yjs Collaboration example, ⌘C or ⌘V on a whole selected line empties the line in all four peers, and nothing is copied or pasted

Abierto
#5,280 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@zbeyens ya está trabajando en esto.

Desde el 27/10/2026.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
react, typescript
Área
frontend, testing

Línea de trabajo

Start with the key handler in apps/www/src/app/(app)/examples/plite/_examples/yjs-collaboration.tsx, especially onKeyDown and the handleDeleteKeyDown whole-line branch around the cited lines. Trace how keydown events and selected text reach replaceBlockTextWithEmpty; compare the behavior with the collaboration demo, which the issue reports works correctly. Reproduce whole-line copy, arrow-key, and paste cases across peers; done when copy preserves the line and paste replaces the selection as expected.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug plugin:yjs target:beta

Testing lane

  • Repository: udecode/plate
  • Branch: next
  • Release channel: Beta
  • Exact commit/package version: NOT_ENOUGH_INFO

Summary

On /examples/plite/yjs-collaboration, selecting a whole line in a peer's editor and pressing ⌘C empties that line in all four peers, and nothing is written to the clipboard. The line is already empty while ⌘ is held, before C is pressed. Other keys do the same: → with the whole line selected also empties it. In natamox's hand retest in Chrome on 2026-10-24, ⌘V over a whole selected line also leaves an empty line, and the pasted text does not appear.

Reproduction

The page shows four peers, Peer A to Peer D, each with its own editor. All four start with Hello world!.

Repro 1: /examples/plite/yjs-collaboration, Chromium

An agent ran this with Playwright.

  1. Open https://beta.platejs.org/examples/plite/yjs-collaboration.
  2. In Peer A's editor, click the end of Hello world!, press Enter and type QA copy line. The new line appears in all four peers.
  3. For comparison, press ⌥⇧← twice to select copy line, then press ⌘C. The clipboard now holds copy line, and the line stays.
  4. Click the end of QA copy line and press ⌘⇧← to select the whole line.
  5. Press and hold ⌘.
  6. Press C, then release both keys.

In step 5 the line becomes an empty line in all four peers. After step 6 the clipboard still holds copy line from step 3. Playwright WebKit gives the same result. In another run, pressing → in place of steps 5 and 6 also emptied the line in all four peers, in both engines.

Repro 2: /examples/plite/yjs-collaboration, Safari

An agent drove desktop Safari on macOS on 2026-10-20 (PT). The session's report shows the keys were sent by a script with fixed waits, and the page text was read through the macOS accessibility tree.

  1. In Peer A, on a new last line QA alpha beta, press ⌘→, then ⌘⇧← to select the line.
  2. Press ⌘C and wait 0.3 seconds.
  3. Press →, Return, wait 0.15 seconds, and press ⌘V.

After step 2, QA alpha beta is gone from all four peers. After step 3, one QA alpha beta comes back on a new line. Later in the session, the same steps on the line QA alpha beta你好 emptied it again, and the paste gave the older QA alpha beta without 你好.

Repro 3: paste over a whole line, Chrome, by hand

natamox ran this by hand in desktop Chrome on 2026-10-24 (PT).

  1. Open https://beta.platejs.org/examples/plite/yjs-collaboration.
  2. In Peer A, double-click world in Hello world! and press ⌘C. The line stays.
  3. Click the end of Hello world!, press Enter and type QA paste line.
  4. Press ⌘⇧← to select the whole line.
  5. Press ⌘V.

The line is left empty, and world does not appear.

Expected

⌘C copies the selection and leaves the document as it is, and ⌘V replaces the selected line with the clipboard text. The same editor already does this for part of a line: in step 3 of Repro 1, ⌘C on copy line copies it and the line stays. The Collaboration Demo on the same Beta does it for a whole line: in the 2026-10-24 replay, selecting Ada's whole line on /examples/plite/collaboration-demo and pressing ⌘C put the full line on the clipboard, and both editors kept it, in Chromium and in Playwright WebKit.

Actual

  • With a whole line selected, pressing ⌘ empties the line in all four peers before C is pressed.
  • ⌘C then writes nothing new to the clipboard.
  • → and other keys pressed with the whole line selected empty it the same way.
  • The emptied line stays as an empty line in every peer.
  • In natamox's hand retest in Chrome on 2026-10-24 (Repro 3), ⌘V over a whole selected line leaves the line empty, and the pasted text does not appear.

Environment

  • Exact next commit/Beta package version: NOT_ENOUGH_INFO. The page names no build. Repro 2's report does not name one either.
  • Repro 1 and its recording: an agent on 2026-10-24, at natamox's request, in headless Chromium 149.0.7827.55 on macOS, driven by Playwright with real mouse and key input. The same steps in Playwright WebKit 26.5 (not Safari) also fail. In Chromium the readout reads the clipboard through the page's clipboard API. In both engines a paste into a plain text field outside the editors confirmed what the clipboard held.
  • Repro 2: an agent in desktop Safari on macOS, 2026-10-20 (PT). The Safari version was not recorded.
  • An agent also reproduced it on 2026-10-20 (PT) in a desktop Chrome 155 window, on Beta 7f98d46ed5 as that run's notes name it. After ⌘C on the whole line QA copy line, the line emptied in all four peers, and a paste gave the earlier clipboard text clipboard-reset.
  • natamox retested by hand on 2026-10-22 (PT) and recorded that neither copy nor paste worked. The browser was not recorded.
  • Repro 3: natamox by hand in desktop Chrome on 2026-10-24 (PT). The Chrome version was not recorded.
  • Firefox was not tried. Nobody has tried a phone.

Caveat

  • From a reading of the example's code on next, not checked with a debugger: the editor's onKeyDown (apps/www/src/app/(app)/examples/plite/_examples/yjs-collaboration.tsx:1769) calls handleDeleteKeyDown (:964, through :1233) for every key. Only the whole-document branch checks for Backspace or Delete (:908). When the page selection's text equals one block's text (:952 to :962), the whole-line branch calls preventDefault (:988) and replaces that block's text with an empty text (:990, replaceBlockTextWithEmpty at :873). The branch for a selected paragraph node (:971 to :980) does not check the key either. This fits the replay, where the keydown of ⌘ itself was the first prevented key and emptied the line, and C then met an empty selection. If so, this is the example's own key handler, not Plite core.
  • /examples/plite/yjs-hocuspocus has the same handler (yjs-hocuspocus.tsx:782, the clearing call at :807, called from :1042). That page was not tested: on the public Beta its four peers cannot reach the server it connects to by default (ws://localhost:4444/yjs, :90).
  • The headless replay on 2026-10-24 did not reproduce the paste part. There, the keydown of ⌘ emptied the selected line first, and the paste then landed in the empty line, so the line ended up holding the pasted text in all four peers: plain text in Chromium and WebKit, and HTML <p>A</p><p>B</p> in WebKit. natamox's hand retests on 2026-10-22 (browser not recorded) and in Chrome on 2026-10-24 both ended with an empty line. Why the two differ is not known. Later in the Safari session of Repro 2, an HTML paste of <p>A</p><p>B</p> after ⌘⇧← on the line also left the line gone, with neither A nor B showing, but its report could not confirm what was selected.
  • What Safari's ⌘C wrote is unclear. In Repro 2 the paste after the first ⌘C gave QA alpha beta, and the report did not read the clipboard.

Evidence

  • Repro 1: headless Chromium recording, 28.2 seconds, with an English step panel beside the page. A dark readout box at the bottom left, drawn by the test script, shows the keys held, the selected text, the clipboard as the script reads it, and line 2 of each peer. At 0:02.3 the click lands at the end of Hello world!, and by 0:04 all four peers show QA copy line. From 0:06.3 the control selects copy line, and by 0:07.8 the clipboard reads copy line. At 0:09.9 the click lands at the end of the line, and by 0:10.6 the selected text is QA copy line. At 0:13.0 ⌘ goes down, and line 2 of all four peers becomes empty. At 0:15.5 C is pressed, and the clipboard still reads copy line. The result shows from 0:19.2 to the end.
  • Repro 2: a 16-second excerpt of the Safari session's recording. Safari's toolbar is cropped out. The caption band at the top comes from the original recording and also names later steps that this excerpt leaves out. At 0:02 QA alpha beta is highlighted in Peer A. At 0:07.8, after ⌘C, the line disappears from Peer A and Peer B. At 0:13.3, after →, Return and ⌘V, the view scrolls, and Peer A shows QA alpha beta on a new line below an empty one.
Repro 1 — headless Chromium, /examples/plite/yjs-collaboration

https://github.com/user-attachments/assets/9e3a0233-6be0-49ea-a776-8b9ecc30c116

Repro 2 — Safari, /examples/plite/yjs-collaboration

https://github.com/user-attachments/assets/9a928b4b-d160-4300-9123-dbc7aa40f04c

Lenguaje dominante
TypeScript
Estrellas
16.6k
Forks
993
Merge medio
20 h 1 min
PR fusionados (30 d)
61

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de udecode/plate

Todos los issues de udecode/plate

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.