Skip to content

Commit f77e402

Browse files
committed
Use correct conditional to prevent overscrolling in DayPickerGroup
Fixes #512
1 parent 2c1588c commit f77e402

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/src/main/java/com/wdullaer/materialdatetimepicker/date/DayPickerGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public void onClick(@NonNull View v) {
179179
// updateButtonVisibility only triggers when a scroll is completed. So a user might
180180
// click the button when the animation is still ongoing potentially pushing the target
181181
// position outside of the bounds of the dayPickerView
182-
if (position >= 0 || position < dayPickerView.getCount()) {
182+
if (position >= 0 && position < dayPickerView.getCount()) {
183183
dayPickerView.smoothScrollToPosition(position);
184184
updateButtonVisibility(position);
185185
}

0 commit comments

Comments
 (0)