mirror of https://github.com/linebender/xilem
Only send ImeMoved signal for focused text input (#684)
This commit is contained in:
parent
f4848ce937
commit
cdda9b542d
|
@ -38,7 +38,7 @@ fn compose_widget(
|
|||
}
|
||||
|
||||
// TODO - Add unit tests for this.
|
||||
if moved {
|
||||
if moved && state.item.accepts_text_input && global_state.is_focused(state.item.id) {
|
||||
let ime_area = state.item.get_ime_area();
|
||||
global_state.emit_signal(RenderRootSignal::new_ime_moved_signal(ime_area));
|
||||
}
|
||||
|
|
|
@ -582,6 +582,10 @@ impl RenderRootState {
|
|||
pub(crate) fn focus_changed(&self) -> bool {
|
||||
self.focused_widget != self.next_focused_widget
|
||||
}
|
||||
|
||||
pub(crate) fn is_focused(&self, id: WidgetId) -> bool {
|
||||
self.focused_widget == Some(id)
|
||||
}
|
||||
}
|
||||
|
||||
impl RenderRootSignal {
|
||||
|
|
Loading…
Reference in New Issue