Skip to content

Bug: Input box prematurely commits IME composition when text wraps to a new line #348

@SpecterHi

Description

@SpecterHi

Describe the bug

There is a critical input bug in the embedded assistant's text area when using an IME (Input Method Editor), such as Chinese Pinyin. When the text being typed becomes long enough to cause the input area to expand and wrap to a new line, the active IME composition is immediately and incorrectly finalized.

This breaks the user's typing flow mid-word, as demonstrated in the attached screenshot where the composition zheng'zai was force-committed.

Image

To Reproduce

Steps to reproduce the behavior:

  1. Use a system with a Chinese Pinyin IME enabled.
  2. Navigate to the embedded "Coco" assistant and click into the input text area.
  3. Type a continuous sentence in Chinese. For example, start typing the sentence shown in the screenshot: 如果用拼音输入法,输入的内容刚好触发换行,就会导致...
  4. Continue typing the next word, for instance, zhengzai (for 正在).
  5. As you type these characters, the text will eventually exceed the width of the input box, forcing a line wrap.
  6. Observe: The moment the line wraps, the IME composition for zhengzai is prematurely committed as plain text, preventing the user from finishing the word or selecting from a list of candidates.

Expected behavior

The input box should resize vertically to accommodate the new line of text, while the IME composition string (e.g., the underlined zhengzai) remains active. The user should be able to continue typing their word or phrase without interruption.

Actual behavior

As shown in the screenshot, the moment the text wraps, the active IME composition is finalized. The partially typed pinyin zheng'zai is inserted as plain text, and the composition session is terminated. The user is forced to delete the incorrect text and re-type the word.

Screenshot

The following screenshot perfectly illustrates the issue. The text has just wrapped, and the composition for zheng'zai has been incorrectly committed.

(You can embed your image here in GitHub)
image

Environment (please complete the following information):

  • OS: [Windows 11]
  • Browser: [Firefox]
  • Input Method Editor (IME): [Microsoft Pinyin, Wechat IME]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions