Fix IME input of `CompositionEnd` without a `CompositionStart` (#3768)
* Closes https://github.com/emilk/egui/issues/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 <emil.ernerfeldt@gmail.com>
This commit is contained in:
parent
f25e4171b9
commit
1efa660149
|
|
@ -1050,7 +1050,8 @@ fn events(
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::CompositionEnd(prediction) => {
|
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.
|
||||||
|
if prediction != "\n" && prediction != "\r" {
|
||||||
state.has_ime = false;
|
state.has_ime = false;
|
||||||
let mut ccursor = delete_selected(text, &cursor_range);
|
let mut ccursor = delete_selected(text, &cursor_range);
|
||||||
if !prediction.is_empty() {
|
if !prediction.is_empty() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue