From c4bc7be5d18b2760c549f1209061f26f9db81156 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Tue, 23 Jun 2020 19:27:24 +0300 Subject: [PATCH] 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. --- src/components/utilities.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/utilities.rs b/src/components/utilities.rs index eafa15fc..58685411 100644 --- a/src/components/utilities.rs +++ b/src/components/utilities.rs @@ -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()