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

avoid premature message submission when using IME #277

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

kun432
Copy link
Contributor

@kun432 kun432 commented Sep 8, 2024

Description

When using Japanese Input Method Editor (IME), the Enter key is also used for finalizing character conversion. This conflicts with pressing the Enter key to submit a message, and causes premature message submission and frustration for Japanese users who are in the middle of inputting text.

This PR ensures that the Enter key will only send the message if the user is not in the middle of an IME conversion, which should provide a more intuitive experience for users typing in Japanese.

NOTES: not sure but this might also happen in other languages which use IME such as Korean and Chinese.

Solution

  • track whether the user is in the middle of an IME conversion by using the compositionstart and compositionend events
  • modify handleKeyDown to only send the message if the Enter key is pressed and the user is not in the middle of an IME conversion.

Reference

@kun432 kun432 changed the title avoid premature form submission when using IME avoid premature message submission when using IME Sep 8, 2024
@weaviate-git-bot
Copy link

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Slack channel?

@kun432
Copy link
Contributor Author

kun432 commented Sep 9, 2024

Agree with CLA

@thomashacker
Copy link
Collaborator

Oh nice catch, thanks a lot for the PR! 🚀

@thomashacker thomashacker changed the base branch from main to dev October 21, 2024 09:22
@thomashacker thomashacker merged commit e48712e into weaviate:dev Oct 21, 2024
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