-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 IME input of CompositionEnd
without a CompositionStart
#3768
Conversation
…y input character.
CompositionEnd
without a CompositionStart
Co-authored-by: Emil Ernerfeldt <[email protected]>
@@ -1050,7 +1050,8 @@ fn events( | |||
} | |||
|
|||
Event::CompositionEnd(prediction) => { | |||
if prediction != "\n" && prediction != "\r" && state.has_ime { | |||
// CompositionEnd only characters may be typed into TextEdit without trigger CompositionStart first, so do not check `state.has_ime = true` in the following statement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it still correct to check it for Event::CompositionUpdate
above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page show that compositionstart
could be fired after a user starts entering a Chinese character using a Pinyin, so when entering some word except compositionend
character, componentstart
fires and state.has_ime
will always be true
, and compositionupdate
will work well. so it's still correct to check it for compositionupdate
because state.has_ime
is always true
when entring word.
I have test the situation that remove all state.has_ime
in CompositionStart
, CompositionUpdate
,CompositionEnd
, it works well.
Also, state.has_ime
is a variable that indicating current input state, maybe some other features will use this variable, so i think keep this variable is a good choice, although it seems useless at current time.
CompositionEnd
without a CompositionStart
CompositionEnd
without a CompositionStart
Add support for type in CompositionEnd only characters without trigger CompositionStart first.
This usually works with no-latin character input.