On Safari, pressing Enter in Chinese input mode sends the message right away. #12209

Closed
opened 2026-02-21 19:06:22 -05:00 by yindo · 1 comment
Owner

Originally created by @LeeeeeeM on GitHub (Mar 27, 2025).

Originally assigned to: @JzoNgKVO on GitHub.

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

chat with chinese ime

Image

✔️ Expected Behavior

I hope i can send message after second confirm

Actual Behavior

just send when i press Enter

Originally created by @LeeeeeeM on GitHub (Mar 27, 2025). Originally assigned to: @JzoNgKVO on GitHub. ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce chat with chinese ime ![Image](https://github.com/user-attachments/assets/54c6262b-eb65-4d53-bb92-a23828a280cd) ### ✔️ Expected Behavior I hope i can send message after second confirm ### ❌ Actual Behavior just send when i press Enter
yindo added the 🐞 bug label 2026-02-21 19:06:22 -05:00
yindo closed this issue 2026-02-21 19:06:22 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 27, 2025):

The issue you're experiencing with Safari, where pressing "Enter" in Chinese input mode sends the message immediately, might be related to how the handleKeyDown function processes the 'Enter' key event. The current implementation prevents the default action and sends the message when 'Enter' is pressed without the 'Shift' key and the event is not in the middle of a composition [1].

To address this, you might need to adjust the logic to better handle input composition events, especially for input methods like Chinese IME. This could involve checking the isComposing property more thoroughly or implementing additional checks to ensure that the message is only sent after the composition is complete and a second confirmation is received.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 27, 2025): <!-- Answer --> The issue you're experiencing with Safari, where pressing "Enter" in Chinese input mode sends the message immediately, might be related to how the `handleKeyDown` function processes the 'Enter' key event. The current implementation prevents the default action and sends the message when 'Enter' is pressed without the 'Shift' key and the event is not in the middle of a composition <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/base/chat/chat/chat-input-area/index.tsx)</sup>. To address this, you might need to adjust the logic to better handle input composition events, especially for input methods like Chinese IME. This could involve checking the `isComposing` property more thoroughly or implementing additional checks to ensure that the message is only sent after the composition is complete and a second confirmation is received. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/22eb6113-be2c-407c-a643-4b97277a4b6b?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/22eb6113-be2c-407c-a643-4b97277a4b6b?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/22eb6113-be2c-407c-a643-4b97277a4b6b?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/22eb6113-be2c-407c-a643-4b97277a4b6b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/22eb6113-be2c-407c-a643-4b97277a4b6b?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/22eb6113-be2c-407c-a643-4b97277a4b6b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/22eb6113-be2c-407c-a643-4b97277a4b6b?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12209