Hacker0x01 / react-datepicker

A simple and reusable datepicker component for React
https://reactdatepicker.com/
MIT License
7.92k stars 2.23k forks source link

fix: invalid time error when selecting excluded month with keyboard #4732

Closed ryantanrk closed 2 months ago

ryantanrk commented 2 months ago

name: Pull Request about: Fixes the date picker throwing an invalid time error when selecting excluded month with the keyboard title: fix: invalid time error when selecting excluded month with keyboard labels: "" assignees: ""

Description

Linked issue: #4731

Problem When an excluded month is selected with the keyboard, the month appears to not be keyboard selected, and when the arrow keys are used again, the Invalid time value error is thrown image

Changes Added a isMonthDisabled check to the onMonthKeyDown function

Screenshots

image

Contribution checklist

martijnrusschen commented 2 months ago

Please check the CI output

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.26%. Comparing base (882867c) to head (7f9fb19). Report is 6 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4732 +/- ## ======================================= Coverage 97.26% 97.26% ======================================= Files 11 11 Lines 1461 1462 +1 Branches 651 652 +1 ======================================= + Hits 1421 1422 +1 Misses 40 40 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.