From ee03e5da56aa4920f91f47b269737c21836578b0 Mon Sep 17 00:00:00 2001 From: Maksim Leyman Date: Sun, 27 Apr 2025 04:47:42 +0300 Subject: [PATCH] Fix `scrollable` touch scrolling when out of bounds --- widget/src/scrollable.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index a10ee771..19d58036 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -876,18 +876,16 @@ where } Event::Touch(event) if state.scroll_area_touched_at.is_some() - || !mouse_over_y_scrollbar - && !mouse_over_x_scrollbar => + || (!mouse_over_y_scrollbar + && !mouse_over_x_scrollbar) => { match event { touch::Event::FingerPressed { .. } => { - let Some(cursor_position) = cursor.position() - else { + if cursor_over_scrollable.is_none() { return; - }; + } - state.scroll_area_touched_at = - Some(cursor_position); + state.scroll_area_touched_at = cursor.position(); } touch::Event::FingerMoved { .. } => { if let Some(scroll_box_touched_at) =