Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[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

オープン
#5,280 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@zbeyens がすでに取り組んでいます。

2026年10月27日 から。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
react, typescript
領域
frontend, testing

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
16.6k
フォーク
993
平均マージ
20時間 21分
マージ済み PR(30日)
60

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

udecode/plate のほかの issue

udecode/plate の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。