Better bounds on SelectView clickable area

This commit is contained in:
Alexandre Bury 2017-10-13 18:11:25 -07:00
parent 44fec0ab50
commit 850e0b2cd1

View File

@ -384,7 +384,13 @@ impl<T: 'static> SelectView<T> {
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);
}