From 76fe6c855bdef3b33174987f692921a6c658abf1 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Mon, 5 Aug 2024 18:09:51 +0900 Subject: [PATCH] Fix: Backspace not working after IME input (#4912) Fix: Changed the handling method of `Ime::Preedit(_, None)` Fix: backspace fail after ime input * Related #4358 * Related #4430 * Related #4436 * Related #4794 * Related #4896 * Closes #4908 Issues: backspace fail after ime input * #4908 (Chinese) Changed the handling method of `Ime::Preedit(_, None)` --- crates/egui-winit/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index e2565794a..b7881e3ca 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -341,8 +341,7 @@ impl State { // We use input_method_editor_started to manually insert CompositionStart // between Commits. match ime { - winit::event::Ime::Enabled => {} - winit::event::Ime::Preedit(_, None) => { + winit::event::Ime::Enabled => { self.ime_event_enable(); } winit::event::Ime::Preedit(text, Some(_cursor)) => { @@ -357,7 +356,7 @@ impl State { .push(egui::Event::Ime(egui::ImeEvent::Commit(text.clone()))); self.ime_event_disable(); } - winit::event::Ime::Disabled => { + winit::event::Ime::Disabled | winit::event::Ime::Preedit(_, None) => { self.ime_event_disable(); } };