[Beta]: With two views of one editor, the Undo and Redo buttons do nothing and clicking past a line's end does not focus the editor
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- playwright, react, typescript
調査の方向性
Start with packages/plitejs/src/react/hooks/use-plite-history.ts and trace applyHistory into packages/plitejs/src/react/editable/editable-dom-runtime.ts and packages/plitejs/src/dom/plugin/dom-root-runtime.ts. Then inspect apps/plite/tests/plite-browser/donor/examples/external-text.test.ts and reproduce both cases in the external-text example. Done means clicks after a line’s end focus the clicked view, and Undo/Redo buttons update the shared history as keyboard shortcuts do.
索引モデルが issue の本文から書いたものです。
説明
Testing lane
- Repository:
udecode/plate - Branch:
next - Release channel: Beta
- Exact commit/package version:
NOT_ENOUGH_INFO
Summary
The example at /examples/plite/external-text shows one Plite document in two views. Native Plite is on the left. External text view is on the right, and its middle block is a plain textarea. Both views share one undo history. On this page:
- Clicking the blank space after a line's end moves the editor's selection to the end of that line, but keyboard focus does not move. The next typed character is lost, or goes into the textarea when the textarea had focus. Clicking on the text itself works.
- The Undo and Redo buttons below Native Plite do nothing. ⌘Z and ⌘⇧Z work.
Both are small. This issue covers both because a reading of the code points to one cause.
Reproduction
Repro 1: /examples/plite/external-text, Chromium
- Open https://beta.platejs.org/examples/plite/external-text in a fresh tab.
- In Native Plite, click the blank space to the right of the first line,
Before the external view. - Type
Z. - In External text view, click the blank space to the right of the same line, and type
Z. - For comparison, click on the word
view.in the first line of Native Plite, and typeZ. - Click the end of the textarea text and type
abc. - Click the blank space to the right of the first line in Native Plite again, and type
Z.
After steps 2 and 4 the editor's selection is at the end of the first line, but keyboard focus stays on the page body, and neither Z appears. In step 5 the Z appears after view. in both views. In step 7 focus stays in the textarea, and the Z goes to the end of the textarea, after abc, not to the first line. A click 2 px or 60 px to the right of the line end gives the same result. WebKit does the same.
Repro 2: /examples/plite/external-text, Chromium
- Open https://beta.platejs.org/examples/plite/external-text in a fresh tab.
- Click the end of the textarea text and type
abc. - Click Undo, below Native Plite. Click it again.
- Click on the word
view.in the first line of Native Plite, and typexyz. - Click Undo.
- For comparison, click the end of the textarea text and press ⌘Z twice.
- Click Redo.
- For comparison, click the textarea and press ⌘⇧Z.
Steps 3 and 5 change nothing, and Undo stays enabled. In step 6 the two ⌘Z presses remove xyz and then abc, and Redo becomes enabled. Step 7 changes nothing. In step 8 ⌘⇧Z brings abc back. In WebKit the buttons do nothing either, and focus is on the page body after the click.
Expected
- A click in the blank space after a line's end puts the caret at the end of that line and focuses the view that was clicked, the same as a click on the text. The agent's run recorded that the Rich Text and Plain Text examples (/examples/plite/richtext and /examples/plite/plaintext) on Beta do this.
- The Undo and Redo buttons undo and redo the latest change from either view, as ⌘Z and ⌘⇧Z do on the same page. The document itself reads
Undo is shared.
Actual
- The click moves the editor's selection to the line end, but focus stays where it was. On a fresh page that is the page body. After the textarea was used, it is the textarea. Typed text is lost or goes into the textarea.
- Clicking an enabled Undo or Redo button changes nothing and shows no error. The button stays enabled.
Environment
- Exact
nextcommit/Beta package version:NOT_ENOUGH_INFO - An agent ran both repros on 2026-10-22 (PT) with Playwright 1.61, using real mouse and keyboard input, in headless Chromium 149.0.7827.55 and in Playwright WebKit 26.5 (not Safari) on macOS. Both engines reproduce both bugs. The recordings use Chromium.
- natamox retested the page by hand on 2026-10-22 (PT), confirmed both bugs, and rated them minor. The browser of that retest was not recorded.
- Not tested: Safari, Firefox, mobile, and real input methods.
Caveat
- This is a reading of the code on
nextat bb6147452c, not confirmed with a breakpoint or a fix. The buttons callapplyHistoryinuseEditorHistory(packages/plitejs/src/react/hooks/use-plite-history.ts:153). It looks up the view throughgetMountedEditableDOMRuntime(packages/plitejs/src/react/editable/editable-dom-runtime.ts:233).pickView(packages/plitejs/src/dom/plugin/dom-root-runtime.ts:333) uses the only view when there is one, and otherwise only the view that contains focus. After a button click, focus is on the button in Chromium or on the page body in WebKit, so the lookup finds no view and the call does nothing. ⌘Z works because its key event finds the view from the event target. - For the click, an agent's probe saw that the mousedown landed on the paragraph element, not on its text, and that the editor handled it itself and set the selection to the line end, so the browser did not move focus. The focus call that should follow goes through the same view lookup. On a fresh page no view has focus, so nothing is focused. When the textarea has focus, the lookup finds the right view, and focus stays in the textarea. This part is an inference. Nobody traced it line by line.
- By the same reading, pages with one view of the editor are not affected.
apps/plite/tests/plite-browser/donor/examples/external-text.test.tscovers keyboard undo and the test harness's undo, but never clicks the two buttons.
Evidence
- Repro 1: headless Chromium recording, 39 seconds. The real page is on the left and an English step panel on the right. The dark box at the bottom of the page is drawn by the test script and is not part of the page. It shows which element has keyboard focus, the editor's model selection as
block,text@offset, the focus moves, the keys pressed and whether the buttons are enabled. An orange ring marks each click. By 0:02 the click after the first line in Native Plite has moved the selection to0,0@25while focus stays on the page body, and theZtyped at 0:04 does not appear. After the click in External text view, theZtyped at 0:11 does not appear either. By 0:14 a click onview.has focused Native Plite, and by 0:15Zshows in both views. At 0:22 the click after the first line in Native Plite leaves focus in the textarea, and by 0:25 theZhas gone into the textarea afterabc. - Repro 2: headless Chromium recording, 42 seconds, in the same layout. At 0:06 and 0:09 the script clicks Undo, and
abcstays. At 0:16 it clicks Undo after typingxyzin Native Plite, and nothing changes. By 0:20 the first ⌘Z has removedxyz, and by 0:21 the second has removedabcand Redo is enabled. At 0:25 it clicks Redo, and nothing changes. By 0:28 ⌘⇧Z has broughtabcback. From 0:21 the page'sOuter input eventscounter reads 2. The first ⌘Z moved focus from the textarea to the right editor along with the restored selection, so the second ⌘Z went through that editor. The tester did not count this as a bug.
Repro 1 — Chromium, /examples/plite/external-text
https://github.com/user-attachments/assets/ef866763-d71a-4d9b-8750-ba6b767e9a61
Repro 2 — Chromium, /examples/plite/external-text
https://github.com/user-attachments/assets/553c4765-4d87-451e-a58a-afc23bf4e9c1
- 主要言語
- TypeScript
- スター
- 16.6k
- フォーク
- 993
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 60
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
udecode/plate のほかの issue
-
triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
mobile triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[Beta]: The docs Demo example page starts with an empty editor対応中かも @natamox が今日担当しました。 オープンtriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
udecode/plate#5308 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apex-dev-tools/apex-log-parser#199 ·
メンテナーはふだん 1 日以内に返信
-
area/frontend/library-panels automated-triage type/bug type/ux
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
PostHog/posthog.com#21607 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
ajv-validator/ajv#2689 ·
-
[Bug]: IME confirmation Enter can submit the SSH port-forward dialog対応中かも @seijikohara が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信