From 0187ab82bdac329a9c3ca975931280dfdceb3326 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Wed, 29 Nov 2023 20:51:02 +0000 Subject: [PATCH] Apply message/event suggestions --- src/view/scroll_view.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/view/scroll_view.rs b/src/view/scroll_view.rs index 2f94d0633..4014791c8 100644 --- a/src/view/scroll_view.rs +++ b/src/view/scroll_view.rs @@ -74,10 +74,15 @@ where &self, id_path: &[Id], state: &mut Self::State, - event: Box, + message: Box, app_state: &mut T, ) -> MessageResult { - let tl = &id_path[1..]; - self.child.message(tl, &mut state.1, event, app_state) + match id_path { + [child_id, rest_path @ ..] if *child_id == state.0 => { + self.child + .message(rest_path, &mut state.1, message, app_state) + } + _ => MessageResult::Stale(message), + } } }