[Bug]: Unable to type Chinese (IME broken) in the input area after selecting an image attachment
Summary
When selecting an image attachment via the file picker before typing any text, Chinese input via IME (Input Method Editor) stops working completely—the IME composition/candidate box fails to appear. However, direct English (ASCII) input continues to work normally.
To Reproduce
- Open the chat / message composer.
- Do not type any text yet.
- Click the attachment button and pick an image via the system file dialog.
- After the file is selected, try typing in Chinese using an IME (e.g., Pinyin).
- Actual Behavior: No IME candidate window appears, and keystrokes are ignored or fail to compose. Switching to English input works fine.
- Expected Behavior: IME composition should work properly, allowing Chinese input right after attaching a file.
Expected behavior
The IME composition window should appear normally, and users should be able to type Chinese text after attaching an image.
Actual behavior
The IME candidate window does not show up, and Chinese characters cannot be entered. Switching to an English input method works fine.
Screenshots (optional)
No response
OW version & Desktop info (optional)
- OpenWork version:0.18.46
- OS: macOS Sequoia 15.7.1
Additional context (optional)
Workaround: Clicking outside the input field to blur it, and then clicking back inside to refocus, immediately restores IME functionality. Suspected Cause: Returning from the native OS file picker interrupts Chromium's IME context, preventing compositionstart events from firing properly. Suggested Fix: In the file input's onChange callback, explicitly trigger an element blur() followed by a deferred focus() (wrapped in setTimeout(..., 50) or requestAnimationFrame) to reconnect the IME state machine.
Source: different-ai/openwork