Skip to content

Commit

Permalink
Remove the placeholder text when IME is activated in text input
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Feb 4, 2025
1 parent 782b96b commit e4ff212
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion widget/src/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit e4ff212

Please sign in to comment.