Skip to content

Commit

Permalink
Use correct conditional to prevent overscrolling in DayPickerGroup
Browse files Browse the repository at this point in the history
Fixes #512
  • Loading branch information
wdullaer committed Oct 9, 2018
1 parent 2c1588c commit f77e402
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void onClick(@NonNull View v) {
// updateButtonVisibility only triggers when a scroll is completed. So a user might
// click the button when the animation is still ongoing potentially pushing the target
// position outside of the bounds of the dayPickerView
if (position >= 0 || position < dayPickerView.getCount()) {
if (position >= 0 && position < dayPickerView.getCount()) {
dayPickerView.smoothScrollToPosition(position);
updateButtonVisibility(position);
}
Expand Down

0 comments on commit f77e402

Please sign in to comment.