-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Bug Description
When using Chinese (CJK) Input Method Editor (IME) in the web chat UI, pressing Enter to confirm/select a character from the candidate list immediately sends the message instead of just confirming the character selection.
Steps to Reproduce
- Open the OpenFang dashboard chat (
http://127.0.0.1:4200) - Switch to a Chinese IME (e.g., Pinyin)
- Type pinyin characters (e.g., "ni hao")
- When the candidate list appears, press Enter to select a character
- Expected: The selected character is inserted into the input field
- Actual: The incomplete/partial text is sent as a message immediately
Expected Behavior
Pressing Enter during IME composition should only confirm the character selection. The message should only be sent when Enter is pressed after composition ends (i.e., when isComposing is false).
Suggested Fix
Add an isComposing check to the keydown event handler:
textarea.addEventListener('keydown', (e) => {
if (e.key === 'Enter' && !e.isComposing) {
sendMessage();
}
});Environment
- OS: macOS (Apple Silicon)
- OpenFang version: 0.3.29
- IME: macOS built-in Chinese Pinyin
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels