From 9b78e6252496dc72ad9c0a1bbd7ed50a542f7930 Mon Sep 17 00:00:00 2001 From: jrmoulton Date: Thu, 14 Mar 2024 21:19:19 -0600 Subject: [PATCH] automatically propagate pointer events when scroll end --- src/views/scroll.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/views/scroll.rs b/src/views/scroll.rs index 3ecc208c..278bc7d7 100644 --- a/src/views/scroll.rs +++ b/src/views/scroll.rs @@ -311,6 +311,8 @@ impl Scroll { if let Some(onscroll) = &self.onscroll { onscroll(child_viewport); } + } else { + return None; } Some(()) } @@ -870,15 +872,15 @@ impl Widget for Scroll { } else { delta }; - self.clamp_child_viewport(cx.app_state, self.child_viewport + delta); + let any_change = self.clamp_child_viewport(cx.app_state, self.child_viewport + delta); // Check if the scroll bars now hover self.update_hover_states(cx.app_state, pointer_event.pos); - return if !self.propagate_pointer_wheel { - EventPropagation::Stop - } else { + return if self.propagate_pointer_wheel || any_change.is_none() { EventPropagation::Continue + } else { + EventPropagation::Stop }; }