From 850e0b2cd1398e6d4915b3d3ec09d8192aea8208 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Fri, 13 Oct 2017 18:11:25 -0700 Subject: [PATCH] Better bounds on SelectView clickable area --- src/views/select_view.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/views/select_view.rs b/src/views/select_view.rs index fdac8c9..98abe3d 100644 --- a/src/views/select_view.rs +++ b/src/views/select_view.rs @@ -384,7 +384,13 @@ impl SelectView { position, offset, } => if let Some(position) = position.checked_sub(offset) { - if position < self.last_size { + let scrollbar_size = if self.scrollbase.scrollable() { + (2, 0) + } else { + (0, 0) + }; + let clickable_size = self.last_size.saturating_sub(scrollbar_size); + if position < clickable_size { fix_scroll = false; self.focus.set(position.y + self.scrollbase.start_line); }