bug(DatePicker): Keyboard focus lost after selecting first date in range (accessibility failure) #29265
Labels
area: cdk/a11y
area: material/datepicker
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When custom
dateFilter
functions are used to control which dates can be selected for the start and end dates on amat-date-range-input
, the keyboard focus is lost/reset after the user selects a start date. They must tab several times to get back to the right place so they can select their end date.Note I'm dynamically switching between two different
dateFilter
functions, depending on which date is being selected.This issue is causing us to fail our accessibility audit.
Reproduction
StackBlitz link: https://stackblitz.com/edit/4yvmaz?file=src%2Fexample%2Fdate-range-picker-overview-example.html
Steps to reproduce:
Expected Behavior
The Custom Date Filters Example provided should work exactly like the Basic Example. After selecting a start date, you should be able to use the arrows and Enter key again to select an end date.
Actual Behavior
Focus seems to be lost or reset after the first date is selected.
I thought it might be related to the fact that the date that currently has focus (the selected start date) gets disabled in my example due to my end date requirements. But even if I allow the start date as a valid end date, the problem persists.
Environment
The text was updated successfully, but these errors were encountered: