From e8c680ce66b6b766a196e799b209e73e0bf416ab Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 3 Feb 2025 16:55:10 +0100 Subject: Request redraws on `InputMethod` events --- widget/src/text_editor.rs | 4 ++++ widget/src/text_input.rs | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'widget') diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index 26d05ccd..486741c6 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -754,6 +754,8 @@ where Ime::Toggle(is_open) => { state.preedit = is_open.then(input_method::Preedit::new); + + shell.request_redraw(); } Ime::Preedit { content, selection } => { if state.focus.is_some() { @@ -761,6 +763,8 @@ where content, selection, }); + + shell.request_redraw(); } } Ime::Commit(text) => { diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index 4c9e46c1..b22ee1ca 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -36,13 +36,13 @@ mod value; pub mod cursor; pub use cursor::Cursor; -use iced_runtime::core::input_method; pub use value::Value; use editor::Editor; use crate::core::alignment; use crate::core::clipboard::{self, Clipboard}; +use crate::core::input_method; use crate::core::keyboard; use crate::core::keyboard::key; use crate::core::layout; @@ -1257,6 +1257,8 @@ where state.is_ime_open = matches!(event, input_method::Event::Opened) .then(input_method::Preedit::new); + + shell.request_redraw(); } input_method::Event::Preedit(content, selection) => { let state = state::(tree); @@ -1266,6 +1268,8 @@ where content: content.to_owned(), selection: selection.clone(), }); + + shell.request_redraw(); } } input_method::Event::Commit(text) => { -- cgit