-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
IME: TextEdit widget cannot support CompositionEnd only input character #3766
Comments
Can you check if |
add log after L731(if self.allow_ime != allow_ime) in crates/egui-winit/src/lib.rs |
Ok, so that at least seems to work. So as far as I understand you, you see It looks to me the use of Since you seem to know how IME should work (I don't 😅), could you please take a look, and perhaps make a PR if you figure out a fix? 🙏 |
Thank you for your help. I'll make a PR later.😀 |
Here is a PR for this bugfix. #3768 |
* Closes #3766 Add support for type in CompositionEnd only characters without trigger CompositionStart first. This usually works with no-latin character input. --------- Co-authored-by: Emil Ernerfeldt <[email protected]>
Describe the bug
Can not input CompositionEnd character directly into TextEditor.
when input no-latin character such as Chinese into TextEditor, i must first input some word to trigger CompositionStart/CompositionUpdate event, then input some mark to trigger CompositionEnd event.
if i just want to type in a single character that trigger CompositionEnd event, TextEditor won't insert this character to text.
To Reproduce
1.Setup a demo app containing a TextEdit
2.Use Chinese PinYin input.
3.Do not type in any other word, just press [shift+1] , [shift+6] , [,], [.], [?] or any other CompositionEnd character.
4.Nothing typed into TextEdit
Expected behavior
Expected to type in Chinese character directly such as !……,。《》、【】without need to trigger CompositionStart/CompositionUpdate event.
Desktop (please complete the following information):
- OS: Windows11 Naive
- Browser Naive App
- Version 0.24.1 and master branch
/crates/egui/src/widgets/text_edit/builder.rs L1061.

if prediction != "\n" && prediction != "\r" && state.has_ime
this line ensure that i cannot input any CompositionEnd character unless input something to trigger CompositionStart to make
has_ime
as true.tried to modify this line to
if prediction != "\n" && prediction != "\r"
if don't ensure
has_ime
be true, input CompositionEnd character directly successfully. Also, following some CompositionStart/CompositionUpdate character works too.The text was updated successfully, but these errors were encountered: