Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Prevent message sending when using IME composition #5192

Closed
wants to merge 1 commit into from

Conversation

jabee0228
Copy link

@jabee0228 jabee0228 commented Feb 20, 2025

What problem does this PR solve?

This pull request addresses an issue where the "Enter" key would send the message prematurely while using Input Method Editor (IME) for text composition. This problem occurs when users are typing with a non-Latin input method, such as Chinese(Zhuyin), and press "Enter" to confirm their selection, which unintentionally triggers message submission.

Before:

Screen.Recording.2025-02-20.at.3.54.44.PM.mov

After:

Screen.Recording.2025-02-20.at.3.48.37.PM.mov

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

@cike8899
Copy link
Contributor

You can consider using "sendLoading" directly to prevent triggering "enter" and causing the message to be sent again.

@jabee0228
Copy link
Author

You can consider using "sendLoading" directly to prevent triggering "enter" and causing the message to be sent again.

I think you misunderstood the issue. The problem is that usually IME input method users need to press enter to confirm Chinese characters, so directly listening to enter will cause IME user to be unable to use it normally. Use isComposiong to wait until the user is using an IME. Does not affect English input.

@KevinHuSh
Copy link
Collaborator

KevinHuSh commented Feb 20, 2025

Appreciation!

After this alteration, we discover that user can sent message continuely no matter the assistant is doing stream talking or not. That's innapropriate.

@jabee0228
Copy link
Author

Appreciation!

After this alteration, we discover that user can sent message continuely no matter the assistant is doing stream talking or not. That's innapropriate.

Yeah, you are right!

@KevinHuSh KevinHuSh closed this Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants