diff --git a/crates/egui/src/widgets/text_edit/builder.rs b/crates/egui/src/widgets/text_edit/builder.rs index 3d6ecb185f6..1a2243a92e7 100644 --- a/crates/egui/src/widgets/text_edit/builder.rs +++ b/crates/egui/src/widgets/text_edit/builder.rs @@ -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. + if prediction != "\n" && prediction != "\r" { state.has_ime = false; let mut ccursor = delete_selected(text, &cursor_range); if !prediction.is_empty() {