summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor <hector@hecrj.dev>2025-02-04 19:12:59 +0100
committerLibravatar GitHub <noreply@github.com>2025-02-04 19:12:59 +0100
commit1f9723a9296082ea06b7280833c60e8f2e547cb5 (patch)
tree9e30408147a261305cb052d8c8ff7d5fd6401267
parent782b96b52f59dcde75bfa9d4affc8852e635e781 (diff)
parenteedaa376b9f7b256fdc09dc2aa4f109ad4e311d6 (diff)
downloadiced-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.rs8
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()