diff options
author | 2025-02-04 19:12:59 +0100 | |
---|---|---|
committer | 2025-02-04 19:12:59 +0100 | |
commit | 1f9723a9296082ea06b7280833c60e8f2e547cb5 (patch) | |
tree | 9e30408147a261305cb052d8c8ff7d5fd6401267 | |
parent | 782b96b52f59dcde75bfa9d4affc8852e635e781 (diff) | |
parent | eedaa376b9f7b256fdc09dc2aa4f109ad4e311d6 (diff) | |
download | iced-1f9723a9296082ea06b7280833c60e8f2e547cb5.tar.gz iced-1f9723a9296082ea06b7280833c60e8f2e547cb5.tar.bz2 iced-1f9723a9296082ea06b7280833c60e8f2e547cb5.zip |
Merge pull request #2785 from rhysd/fix-placeholder-ime-pos
Remove the placeholder text when IME is activated in text input
-rw-r--r-- | widget/src/text_input.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index 215ecbd6..7be5bbd9 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -582,7 +582,13 @@ where }; let draw = |renderer: &mut Renderer, viewport| { - let paragraph = if text.is_empty() { + let paragraph = if text.is_empty() + && state + .is_ime_open + .as_ref() + .map(|preedit| preedit.content.is_empty()) + .unwrap_or(true) + { state.placeholder.raw() } else { state.value.raw() |