Repository navigation
Description
Description
Ending or interrupting an uncommitted Chinese IME composition can leave the caret at the wrong offset across Slate examples.
This is not limited to the Images example. The same composition/caret issue was manually reproduced on the current local v2 branch in:
examples/plain-textexamples/richtextexamples/imagesexamples/editable-voidsexamples/inlinesexamples/mentionsexamples/tables
The issue happens when Chinese IME composition is started but not committed, then cancelled or interrupted.
Recording
Screenshots attached below:
Local actual behavior:
Live reference expected behavior:
Video attached below:
issue-001-ime-composition-caret-offset.mp4
A short recording should be attached because the bug depends on the live IME composition state and caret movement.
Video walkthrough:
- Place the caret inside editable Slate text.
- Start typing with a Chinese IME.
- Do not commit the composition.
- Cancel/interact away from the composition, for example by deleting the composition text, pressing
Esc, or clicking elsewhere. - The caret moves to the wrong offset.
- Typing the next character confirms that insertion happens from the wrong position.
Sandbox
No standalone sandbox. Reproduced in the Slate examples site.
Local reproduction URL:
http://localhost:3100/examples/images
Reference URL:
https://www.slatejs.org/examples/images
The same issue was manually reproduced in the other examples listed above.
Steps
To reproduce the behavior:
- Open a Slate example with editable text, such as
examples/plain-text,examples/richtext, orexamples/images. - Click inside editable text and note the caret position.
- Start typing several Chinese characters using a Chinese IME.
- Do not commit the composition.
- End or interrupt the uncommitted composition. Confirmed variants include:
- deleting the composition text
- pressing
Esc - clicking elsewhere before committing
- Observe the caret position.
- Optionally type another character to confirm the next insertion point.
Expectation
The caret should stay at the same logical insertion point where the IME composition began.
If the composition is cancelled or interrupted before commit, the next typed character should insert at that original caret position.
Live reference behavior:
- On the live Slate examples site, ending or interrupting the uncommitted Chinese IME composition keeps the next insertion point aligned with the original caret position.
- The next typed character is inserted at the expected position.
Actual behavior
After ending or interrupting the uncommitted Chinese IME composition, the caret moves to the wrong offset.
In the Codex in-app browser the caret appears to move one offset forward. In Chrome, the visible result can be more severe.
The next typed character is inserted at the wrong position.
Local actual behavior:
- On the local
v2examples site, ending or interrupting the uncommitted Chinese IME composition moves the caret to the wrong offset. - Typing the next character confirms that insertion happens from the shifted caret position.
Environment
- Slate branch:
v2 - Current local commit tested:
ce2bd6c6 - Local examples site:
http://localhost:3100 - Reference examples site:
https://www.slatejs.org - Browser: Chrome on macOS
- Input method: Chinese IME
- OS: macOS
Impact
This affects normal Chinese text entry across multiple Slate examples. Users who cancel, delete, or otherwise interrupt an active IME composition can continue typing from the wrong caret position, which corrupts the intended text insertion point.
Activity
zbeyens commentedon May 10, 2026
🟡 80-94% confidence
🌐 Browser Check
http://localhost:3100/examples/images.plain-text,richtext,editable-voids,inlines,mentions, andtablesif possible.✅ Outcome
🏗️ Design
🧪 Verified
cd /Users/zbeyens/git/slate-v2 && PLAYWRIGHT_RETRIES=0 PLAYWRIGHT_BASE_URL=http://localhost:3100 bun playwright playwright/integration/examples/rendering-strategy-runtime.test.ts --project=chromium --grep "does not push canceled IME composition onto history|keeps text stable after type-delete-cancel IME composition|keeps canceled IME caret anchored for the next typed character"wudidewo12 commentedon May 22, 2026
Retested manually on current local
v2commite62c2046; this is still not fully fixed, but the current failure scope appears narrower than the original report.Current behavior
Current classification
This issue should remain open. The original uncommitted-composition wording may no longer describe the only failing path, but the same IME/caret-offset family still reproduces after committed Chinese input.
Evidence
Fresh video would be best here because this depends on the real macOS Chinese IME candidate/commit path:
CleanShot.2026-05-23.at.00.09.57.mp4
Suggested browser check
http://localhost:3100/examples/plaintext.