You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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-text
examples/richtext
examples/images
examples/editable-voids
examples/inlines
examples/mentions
examples/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, or examples/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 v2 examples 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.
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
v2branch in:examples/plain-textexamples/richtextexamples/imagesexamples/editable-voidsexamples/inlinesexamples/mentionsexamples/tablesThe 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:
Esc, or clicking elsewhere.Sandbox
No standalone sandbox. Reproduced in the Slate examples site.
Local reproduction URL:
http://localhost:3100/examples/imagesReference URL:
https://www.slatejs.org/examples/imagesThe same issue was manually reproduced in the other examples listed above.
Steps
To reproduce the behavior:
examples/plain-text,examples/richtext, orexamples/images.EscExpectation
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:
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:
v2examples site, ending or interrupting the uncommitted Chinese IME composition moves the caret to the wrong offset.Environment
v2ce2bd6c6http://localhost:3100https://www.slatejs.orgImpact
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.