Avoid dragging scroll area when touching scrollbars for Scrollable

This commit is contained in:
Héctor Ramón Jiménez 2023-01-08 20:27:15 +01:00
parent f64e95e246
commit 2d007474dd
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -516,7 +516,10 @@ pub fn update<Message>(
return event::Status::Captured;
}
Event::Touch(event) => {
Event::Touch(event)
if state.scroll_area_touched_at.is_some()
|| !mouse_over_y_scrollbar && !mouse_over_x_scrollbar =>
{
match event {
touch::Event::FingerPressed { .. } => {
state.scroll_area_touched_at = Some(cursor_position);