Skip to content

Commit

Permalink
Fix error when only 2 or less scrolling items are visible
Browse files Browse the repository at this point in the history
  • Loading branch information
jessarcher committed Jul 29, 2023
1 parent 312db87 commit 3340cf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Themes/Default/Concerns/DrawsScrollbars.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ protected function scrollPosition(Collection $visible, ?int $focused, int $heigh
$keys = $visible->slice(1, -1)->keys();
$position = (int) ceil($percent * count($keys) - 1);

return $keys[$position];
return $keys[$position] ?? 0;
}
}

0 comments on commit 3340cf4

Please sign in to comment.