Merge pull request #2906 from lmaxyz/master

Fix scrollable scrolling by touch
This commit is contained in:
Héctor 2025-11-25 22:01:57 +01:00 • committed by GitHub
commit 45aecccfe5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -876,18 +876,16 @@ where
} }
Event::Touch(event) Event::Touch(event)
if state.scroll_area_touched_at.is_some() if state.scroll_area_touched_at.is_some()
|| !mouse_over_y_scrollbar || (!mouse_over_y_scrollbar
&& !mouse_over_x_scrollbar => && !mouse_over_x_scrollbar) =>
{ {
match event { match event {
touch::Event::FingerPressed { .. } => { touch::Event::FingerPressed { .. } => {
let Some(cursor_position) = cursor.position() if cursor_over_scrollable.is_none() {
else {
return; return;
}; }
state.scroll_area_touched_at = state.scroll_area_touched_at = cursor.position();
Some(cursor_position);
} }
touch::Event::FingerMoved { .. } => { touch::Event::FingerMoved { .. } => {
if let Some(scroll_box_touched_at) = if let Some(scroll_box_touched_at) =