Thinkmill / Thinkmill/keystatic
Japanese IME composition is broken on the first character in an empty Markdoc field
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 159
- Avg merge
- 21h 41m
- Merged PRs (30d)
- 2
Description
Japanese IME composition is broken on the first character in the rich text editor
Japanese IME input is broken when typing the first character into an empty Keystatic rich text editor.
This is not specific to fields.markdoc(), fields.mdx(), or entryLayout: "content".
I can reproduce the same behavior across the rich text editor itself.
For example, when trying to type:
にほんご
the editor produces:
nいほんご
The first n is committed separately instead of being included in the IME composition.
Steps to reproduce
- Open an entry containing a Keystatic rich text field.
- Focus an empty editor.
- Enable a Japanese IME.
- Type
nihongo.
Expected:
にほんご
Actual:
nいほんご
Browser behavior
I can reproduce this in both:
- Google Chrome
- Mozilla Firefox
Additional findings
The issue is reproducible with different rich text field types, including:
fields.markdoc()fields.mdx()
It also occurs regardless of whether entryLayout: "content" is used.
Because of this, the problem appears to be in the shared rich text editor implementation rather than in Markdoc, MDX, or the collection layout.
The problem seems to occur specifically when typing the first character into an empty editor.
Once the editor already contains text, Japanese IME input works normally.
Suspected behavior
It looks like the IME composition is interrupted immediately after the first romaji character is entered.
For example, while trying to type:
nihongo
the first:
n
is committed separately, and the remaining:
ihongo
continues as a new IME composition.
This suggests that the editor may be changing the DOM, selection, or editor state while the initial IME composition is active.
Additional information
I have a GIF showing the issue clearly and can attach it to this issue.
The issue is reproducible with Japanese IME input in both Chrome and Firefox.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the shared rich text editor implementation, since the issue reproduces across Markdoc and MDX fields and entry layouts. Reproduce the first-character Japanese IME case in Chrome or Firefox, then verify that typing nihongo into an empty editor produces にほんご without interrupting composition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100