Tabbed: correctly pass events to other children

When passing an event to the focused tab and it is not handled, the
other children weren't then each called to see if they handle the
event. That led to refresh events etc not being processed by the mail
list tab if it wasn't focused.
async
Manos Pitsidianakis 2020-06-23 19:27:24 +03:00
parent 4ae7a57d45
commit c4bc7be5d1
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 8 additions and 1 deletions

View File

@ -1864,7 +1864,14 @@ impl Component for Tabbed {
}
_ => {}
}
self.children[self.cursor_pos].process_event(event, context)
let c = self.cursor_pos;
self.children[c].process_event(event, context)
|| self.children.iter_mut().enumerate().any(|(idx, child)| {
if idx == c {
return false;
}
child.process_event(event, context)
})
}
fn is_dirty(&self) -> bool {
self.dirty || self.children[self.cursor_pos].is_dirty()