summaryrefslogtreecommitdiffstats
path: root/widget
diff options
context:
space:
mode:
authorLibravatar rhysd <lin90162@yahoo.co.jp>2025-02-04 19:48:36 +0900
committerLibravatar rhysd <lin90162@yahoo.co.jp>2025-02-05 00:53:16 +0900
commiteedaa376b9f7b256fdc09dc2aa4f109ad4e311d6 (patch)
tree9e30408147a261305cb052d8c8ff7d5fd6401267 /widget
parent782b96b52f59dcde75bfa9d4affc8852e635e781 (diff)
downloadiced-eedaa376b9f7b256fdc09dc2aa4f109ad4e311d6.tar.gz
iced-eedaa376b9f7b256fdc09dc2aa4f109ad4e311d6.tar.bz2
iced-eedaa376b9f7b256fdc09dc2aa4f109ad4e311d6.zip
Remove the placeholder text when IME is activated in text input
Diffstat (limited to 'widget')
-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()