-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Handle composition events to show suggestion on web #278
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
Conversation
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.
Thank you! And there is no late - we have no deadlines :)
egui/src/widgets/text_edit.rs
Outdated
| undoer: Undoer<(CCursorPair, String)>, | ||
|
|
||
| // If IME candidate window is shown on this text edit. | ||
| has_candidate: bool, |
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.
I think has_ime would be a more descriptive name
egui/src/widgets/text_edit.rs
Outdated
| if !text_mark.is_empty() | ||
| && text_mark != "\n" | ||
| && text_mark != "\r" | ||
| && state.has_candidate |
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.
So we even need has_candidate? Is it for the case when the user switches between two TextEdit:s while an IME window is open? If so, it should be reset to false when the TextEdit loses focus.
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.
Yes, has_candidate is introduced exactly for that purpose. On my test platforms(Windows 10, Ubuntu 18.04, MacOs Big Sur and iOS 14.4), when user click other place of canvas, compositionend message is send, and such reset logit is done in compositionend handler.
Co-authored-by: Emil Ernerfeldt <[email protected]>
emilk
left a comment
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.
Thanks 🙏
Handle composition events to show IME suggestion on web, as described in #248. Sorry for being late, I have been busy in the past few days.