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;
|
return;
|
||||||
}
|
}
|
||||||
input_method::Event::Preedit(content, selection) => {
|
input_method::Event::Preedit(content, selection) => {
|
||||||
if state.is_focused.is_some() {
|
if state.is_focused() {
|
||||||
state.preedit = Some(input_method::Preedit {
|
state.preedit = Some(input_method::Preedit {
|
||||||
content: content.to_owned(),
|
content: content.to_owned(),
|
||||||
selection: selection.clone(),
|
selection: selection.clone(),
|
||||||
|
|
@ -2106,7 +2106,7 @@ pub fn update<'a, Message: Clone + 'static>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
input_method::Event::Commit(text) => {
|
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;
|
return;
|
||||||
};
|
};
|
||||||
let Some(on_input) = on_input else {
|
let Some(on_input) = on_input else {
|
||||||
|
|
@ -2337,8 +2337,7 @@ fn input_method<'b>(
|
||||||
text_layout: Layout<'_>,
|
text_layout: Layout<'_>,
|
||||||
value: &Value,
|
value: &Value,
|
||||||
) -> InputMethod<&'b str> {
|
) -> InputMethod<&'b str> {
|
||||||
if state.is_focused() {
|
if !state.is_focused() {
|
||||||
} else {
|
|
||||||
return InputMethod::Disabled;
|
return InputMethod::Disabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue