Browse Source

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.
master
parent
commit
c4bc7be5d1
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS. GPG Key ID: 73627C2F690DF710
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      src/components/utilities.rs

+ 8
- 1
src/components/utilities.rs 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()


Loading…
Cancel
Save