Handle composition events to show suggestion on web#278
Merged
emilk merged 5 commits intoemilk:masterfrom Apr 12, 2021
n2:composition
Merged
Handle composition events to show suggestion on web#278emilk merged 5 commits intoemilk:masterfrom n2:composition
emilk merged 5 commits intoemilk:masterfrom
n2:composition
Conversation
emilk
requested changes
Apr 7, 2021
egui/src/widgets/text_edit.rs
Outdated
| undoer: Undoer<(CCursorPair, String)>, | ||
|
|
||
| // If IME candidate window is shown on this text edit. | ||
| has_candidate: bool, |
Owner
There was a problem hiding this comment.
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 |
Owner
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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 <emil.ernerfeldt@gmail.com>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.