Handle pre-edits and commits only if text_editor is focused
This commit is contained in:
parent
50eaef2844
commit
bab18858cd
1 changed files with 10 additions and 9 deletions
|
|
@ -758,15 +758,11 @@ where
|
||||||
shell.request_redraw();
|
shell.request_redraw();
|
||||||
}
|
}
|
||||||
Ime::Preedit { content, selection } => {
|
Ime::Preedit { content, selection } => {
|
||||||
if state.focus.is_some() {
|
state.preedit =
|
||||||
state.preedit = Some(input_method::Preedit {
|
Some(input_method::Preedit { content, selection });
|
||||||
content,
|
|
||||||
selection,
|
|
||||||
});
|
|
||||||
|
|
||||||
shell.request_redraw();
|
shell.request_redraw();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Ime::Commit(text) => {
|
Ime::Commit(text) => {
|
||||||
shell.publish(on_edit(Action::Edit(Edit::Paste(
|
shell.publish(on_edit(Action::Edit(Edit::Paste(
|
||||||
Arc::new(text),
|
Arc::new(text),
|
||||||
|
|
@ -1284,15 +1280,20 @@ impl<Message> Update<Message> {
|
||||||
input_method::Event::Opened
|
input_method::Event::Opened
|
||||||
))))
|
))))
|
||||||
}
|
}
|
||||||
input_method::Event::Preedit(content, selection) => {
|
input_method::Event::Preedit(content, selection)
|
||||||
|
if state.focus.is_some() =>
|
||||||
|
{
|
||||||
Some(Update::InputMethod(Ime::Preedit {
|
Some(Update::InputMethod(Ime::Preedit {
|
||||||
content,
|
content,
|
||||||
selection,
|
selection,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
input_method::Event::Commit(content) => {
|
input_method::Event::Commit(content)
|
||||||
|
if state.focus.is_some() =>
|
||||||
|
{
|
||||||
Some(Update::InputMethod(Ime::Commit(content)))
|
Some(Update::InputMethod(Ime::Commit(content)))
|
||||||
}
|
}
|
||||||
|
_ => None,
|
||||||
},
|
},
|
||||||
Event::Keyboard(keyboard::Event::KeyPressed {
|
Event::Keyboard(keyboard::Event::KeyPressed {
|
||||||
key,
|
key,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue