fix: focus detecting in IME logic
This commit is contained in:
parent
1d01054993
commit
8e3672a7dd
1 changed files with 3 additions and 4 deletions
|
|
@ -2095,7 +2095,7 @@ pub fn update<'a, Message: Clone + 'static>(
|
|||
return;
|
||||
}
|
||||
input_method::Event::Preedit(content, selection) => {
|
||||
if state.is_focused.is_some() {
|
||||
if state.is_focused() {
|
||||
state.preedit = Some(input_method::Preedit {
|
||||
content: content.to_owned(),
|
||||
selection: selection.clone(),
|
||||
|
|
@ -2106,7 +2106,7 @@ pub fn update<'a, Message: Clone + 'static>(
|
|||
}
|
||||
}
|
||||
input_method::Event::Commit(text) => {
|
||||
let Some(focus) = &mut state.is_focused else {
|
||||
let Some(focus) = state.is_focused.as_mut().filter(|f| f.focused) else {
|
||||
return;
|
||||
};
|
||||
let Some(on_input) = on_input else {
|
||||
|
|
@ -2337,8 +2337,7 @@ fn input_method<'b>(
|
|||
text_layout: Layout<'_>,
|
||||
value: &Value,
|
||||
) -> InputMethod<&'b str> {
|
||||
if state.is_focused() {
|
||||
} else {
|
||||
if !state.is_focused() {
|
||||
return InputMethod::Disabled;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue