15 merged IME fixes: the recurring ways Japanese typing breaks web apps
Between late June and early July 2026 I had 15 pull requests merged into open-source projects, all fixing the same family of bug: a keyboard handler that does not know an input method editor (IME) is in the middle of composing text. This post groups them into the bug classes that keep recurring, with a minimal repro and the fix pattern for each. Every fix links to the merged PR so you can read…
Between late June and early July 2026, 15 pull requests were merged into open-source projects, all fixing the same recurring bug involving keyboard handlers that fail to recognize when input method editors (IMEs) are composing text. This post groups the fixes into three classes, each with a minimal reproducible example and the corresponding code pattern to prevent the issue.
Class 1: Enter sends the message mid-composition
When users type a reading, press Enter to pick the kanji, and the chat sends half a sentence in romaji or unconverted kana, the bug in this class occurs. Minimal repro: adding a keyboard event listener to a textarea with the code if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); send(); }. The fix pattern involves checking if the event is in composition mode or has the special keyCode 229, and returning early.
For example, textarea.addEventListener('keydown', (e) => { if (e.isComposing || e.keyCode === 229) return; if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); send(); });.
Class 2: Enter commits a partial value
In this class, users type a tag, list item, card title, or file name, and the IME shows candidates. Pressing Enter commits the unconverted reading, and the actual kanji ends up as a stray entry, or is lost. In validated numeric or formatted fields, the half-typed value is committed and validated. The minimal reproducible example is adding a keyboard event listener to an input with if (e.key === 'Enter' && input.value.trim()) addTag(input.value);.
The fix pattern is the same guard before any commit or validation. For instance, in React, several projects used e.nativeEvent.isComposing, as the handler receives React's synthetic event instead of the DOM KeyboardEvent. Merged evidence includes tusen-ai/naive-ui #8115, onyx-dot-app/onyx #12511, LibreChat-AI/LibreChat #13996, TriliumNext/Trilium #10315, and chakra-ui/zag #3198.
Class 3: Enter selects or searches on unconfirmed text
When users type a term into an autocomplete, picker, or search box, and pressing Enter selects the highlighted option or fires the search with the reading instead of the converted word, the bug in this class happens. Minimal repro is adding a keyboard event listener to a combo box with if (e.key === 'Enter') selectHighlighted();.
The fix pattern requires a guard first, then the select action. Common libraries, such as payloadcms/payload #17138, rsuite/rsuite #4585, and vuetifyjs/vuetify #22974, implemented this fix. Merged evidence includes payloadcms/payload #17138, rsuite/rsuite #4585, and vuetifyjs/vuetify #22974.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.