reecelucas / react-datepicker

An accessible, internationalizable React datepicker
MIT License
12 stars 6 forks source link

First focused date not selectable via keyboard #39

Open CissiWong opened 1 year ago

CissiWong commented 1 year ago

The date that is initially focused and selected in the date picker with calendar, is not selectable by keyboard. Screen readers will announce the initial date as selected, but on pressing enter, the value is in fact not captured.

The user must use arrows to move to another date and then back, in order to select a date and capture the value.

There seem to be no way around this?

To reproduce: Use the basic setup, open the calendar via keyboard and press enter on the first selected date. No console.log is produced.

<DatePicker onSelect={date => console.log(date)}>
  <DatePickerInput />

  <DatePickerCalendar>
    <DatePickerMonth />
    <DatePickerButton updateMonth={({ prev }) => prev()}>
      Prev Month
    </DatePickerButton>
    <DatePickerButton updateMonth={({ next }) => next()}>
      Next Month
    </DatePickerButton>
    <DatePickerTable />
  </DatePickerCalendar>
</DatePicker>