Skip to content

Commit

Permalink
[DatePicker] Fixed incorrect date being selected on scrollable months.
Browse files Browse the repository at this point in the history
Resolves #1973

PiperOrigin-RevId: 351396382
(cherry picked from commit db42490)
  • Loading branch information
hunterstich authored and ikim24 committed Jan 14, 2021
1 parent 814ce6d commit d523523
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ private void updateSelectedStateForDate(MaterialCalendarGridView monthGrid, long
// Validate that the day is in the right month.
int day = month.getDayOfMonth(date);
updateSelectedState(
(TextView) monthGrid.getChildAt(monthGrid.getAdapter().dayToPosition(day)), date);
(TextView)
monthGrid.getChildAt(
monthGrid.getAdapter().dayToPosition(day) - monthGrid.getFirstVisiblePosition()),
date);
}
}

Expand Down

0 comments on commit d523523

Please sign in to comment.