From 46aab24d91eb083a2f030094e33f98ba8e0dad7f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 22 Jul 2021 21:28:21 +0700 Subject: Enable scroll selection for `PickList` only when scroll is discrete --- native/src/widget/pick_list.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/native/src/widget/pick_list.rs b/native/src/widget/pick_list.rs index 667c9f18..ddd0d0a2 100644 --- a/native/src/widget/pick_list.rs +++ b/native/src/widget/pick_list.rs @@ -247,15 +247,11 @@ where event_status } } - Event::Mouse(mouse::Event::WheelScrolled { delta }) - if layout.bounds().contains(cursor_position) - && !*self.is_open => + Event::Mouse(mouse::Event::WheelScrolled { + delta: mouse::ScrollDelta::Lines { y, .. }, + }) if layout.bounds().contains(cursor_position) + && !*self.is_open => { - let y = match delta { - mouse::ScrollDelta::Lines { y, .. } - | mouse::ScrollDelta::Pixels { y, .. } => y, - }; - fn find_next<'a, T: PartialEq>( selected: &'a T, mut options: impl Iterator, -- cgit