@@ -562,72 +562,80 @@ value can be anything that is accepted by `ngClass`.
562
562
563
563
### Accessibility
564
564
565
- The ` MatDatepickerInput ` and ` MatDatepickerToggle ` directives add the ` aria-haspopup ` attribute to
566
- the native input and toggle button elements respectively, and they trigger a calendar dialog with
567
- ` role="dialog" ` .
565
+ The ` MatDatepicker ` pop-up uses the ` role="dialog" ` interaction pattern. This dialog then contains
566
+ multiple controls, the most prominent being the calendar itself. This calendar implements the
567
+ ` role="grid" ` interaction pattern .
568
568
569
- ` MatDatepickerIntl ` includes strings that are used for ` aria-label ` s. The datepicker input
570
- should have a placeholder or be given a meaningful label via ` aria-label ` , ` aria-labelledby ` or
569
+ The ` MatDatepickerInput ` and ` MatDatepickerToggle ` directives both apply the ` aria-haspopup `
570
+ attribute to the native input and button elements, respectively.
571
+
572
+ ` MatDatepickerIntl ` includes strings that are used for ` aria-label ` attributes. Always provide
573
+ the datepicker text input a meaningful label via ` <mat-label> ` , ` aria-label ` , ` aria-labelledby ` or
571
574
` MatDatepickerIntl ` .
572
575
576
+ ` MatDatepickerInput ` adds <kbd >>Alt</kbd > + <kbd >Down Arrow</kbd > as a keyboard short to open the
577
+ datepicker pop-up. However, ChromeOS intercepts this key combination at the OS level such that the
578
+ browser only receives a ` PageDown ` key event. Because of this behavior, you should always include an
579
+ additional means of opening the pop-up, such as ` MatDatepickerToggle ` .
580
+
573
581
#### Keyboard interaction
574
582
575
583
The datepicker supports the following keyboard shortcuts:
576
584
577
- | Shortcut | Action |
578
- | ----------------------| -------------------------------------------|
579
- | ` ALT ` + ` DOWN_ARROW ` | Open the calendar pop-up |
580
- | ` ESCAPE ` | Close the calendar pop-up |
585
+ | Shortcut | Action |
586
+ | ---------------------------------------- | ----------------------------|
587
+ | < kbd > ALT</ kbd > + < kbd > DOWN_ARROW</ kbd > | Open the calendar pop-up |
588
+ | < kbd > ESCAPE</ kbd > | Close the calendar pop-up |
581
589
582
590
583
591
In month view:
584
592
585
- | Shortcut | Action |
586
- | ----------------------| - ------------------------------------------|
587
- | ` LEFT_ARROW ` | Go to previous day |
588
- | ` RIGHT_ARROW ` | Go to next day |
589
- | ` UP_ARROW ` | Go to same day in the previous week |
590
- | ` DOWN_ARROW ` | Go to same day in the next week |
591
- | ` HOME ` | Go to the first day of the month |
592
- | ` END ` | Go to the last day of the month |
593
- | ` PAGE_UP ` | Go to the same day in the previous month |
594
- | ` ALT ` + ` PAGE_UP ` | Go to the same day in the previous year |
595
- | ` PAGE_DOWN ` | Go to the same day in the next month |
596
- | ` ALT ` + ` PAGE_DOWN ` | Go to the same day in the next year |
597
- | ` ENTER ` | Select current date |
593
+ | Shortcut | Action |
594
+ | --------------------------------------- | ------------------------------------------|
595
+ | < kbd > LEFT_ARROW</ kbd > | Go to previous day |
596
+ | < kbd > RIGHT_ARROW</ kbd > | Go to next day |
597
+ | < kbd > UP_ARROW</ kbd > | Go to same day in the previous week |
598
+ | < kbd > DOWN_ARROW</ kbd > | Go to same day in the next week |
599
+ | < kbd > HOME</ kbd > | Go to the first day of the month |
600
+ | < kbd > END</ kbd > | Go to the last day of the month |
601
+ | < kbd > PAGE_UP</ kbd > | Go to the same day in the previous month |
602
+ | < kbd > ALT</ kbd > + < kbd > PAGE_UP</ kbd > | Go to the same day in the previous year |
603
+ | < kbd > PAGE_DOWN</ kbd > | Go to the same day in the next month |
604
+ | < kbd > ALT</ kbd > + < kbd > PAGE_DOWN</ kbd > | Go to the same day in the next year |
605
+ | < kbd > ENTER</ kbd > | Select current date |
598
606
599
607
600
608
In year view:
601
609
602
- | Shortcut | Action |
603
- | ----------------------| -------------------------------------------|
604
- | ` LEFT_ARROW ` | Go to previous month |
605
- | ` RIGHT_ARROW ` | Go to next month |
606
- | ` UP_ARROW ` | Go up a row (back 4 months) |
607
- | ` DOWN_ARROW ` | Go down a row (forward 4 months) |
608
- | ` HOME ` | Go to the first month of the year |
609
- | ` END ` | Go to the last month of the year |
610
- | ` PAGE_UP ` | Go to the same month in the previous year |
611
- | ` ALT ` + ` PAGE_UP ` | Go to the same month 10 years back |
612
- | ` PAGE_DOWN ` | Go to the same month in the next year |
613
- | ` ALT ` + ` PAGE_DOWN ` | Go to the same month 10 years forward |
614
- | ` ENTER ` | Select current month |
610
+ | Shortcut | Action |
611
+ | --------------------------------------- | -------------------------------------------|
612
+ | < kbd > LEFT_ARROW</ kbd > | Go to previous month |
613
+ | < kbd > RIGHT_ARROW</ kbd > | Go to next month |
614
+ | < kbd > UP_ARROW</ kbd > | Go up a row (back 4 months) |
615
+ | < kbd > DOWN_ARROW</ kbd > | Go down a row (forward 4 months) |
616
+ | < kbd > HOME</ kbd > | Go to the first month of the year |
617
+ | < kbd > END</ kbd > | Go to the last month of the year |
618
+ | < kbd > PAGE_UP</ kbd > | Go to the same month in the previous year |
619
+ | < kbd > ALT</ kbd > + < kbd > PAGE_UP</ kbd > | Go to the same month 10 years back |
620
+ | < kbd > PAGE_DOWN</ kbd > | Go to the same month in the next year |
621
+ | < kbd > ALT</ kbd > + < kbd > PAGE_DOWN</ kbd > | Go to the same month 10 years forward |
622
+ | < kbd > ENTER</ kbd > | Select current month |
615
623
616
624
In multi-year view:
617
625
618
- | Shortcut | Action |
619
- | ----------------------| -------------------------------------------|
620
- | ` LEFT_ARROW ` | Go to previous year |
621
- | ` RIGHT_ARROW ` | Go to next year |
622
- | ` UP_ARROW ` | Go up a row (back 4 years) |
623
- | ` DOWN_ARROW ` | Go down a row (forward 4 years) |
624
- | ` HOME ` | Go to the first year in the current range |
625
- | ` END ` | Go to the last year in the current range |
626
- | ` PAGE_UP ` | Go back 24 years |
627
- | ` ALT ` + ` PAGE_UP ` | Go back 240 years |
628
- | ` PAGE_DOWN ` | Go forward 24 years |
629
- | ` ALT ` + ` PAGE_DOWN ` | Go forward 240 years |
630
- | ` ENTER ` | Select current year |
626
+ | Shortcut | Action |
627
+ | --------------------------------------- | -------------------------------------------|
628
+ | < kbd > LEFT_ARROW</ kbd > | Go to previous year |
629
+ | < kbd > RIGHT_ARROW</ kbd > | Go to next year |
630
+ | < kbd > UP_ARROW</ kbd > | Go up a row (back 4 years) |
631
+ | < kbd > DOWN_ARROW</ kbd > | Go down a row (forward 4 years) |
632
+ | < kbd > HOME</ kbd > | Go to the first year in the current range |
633
+ | < kbd > END</ kbd > | Go to the last year in the current range |
634
+ | < kbd > PAGE_UP</ kbd > | Go back 24 years |
635
+ | < kbd > ALT</ kbd > + < kbd > PAGE_UP</ kbd > | Go back 240 years |
636
+ | < kbd > PAGE_DOWN</ kbd > | Go forward 24 years |
637
+ | < kbd > ALT</ kbd > + < kbd > PAGE_DOWN</ kbd > | Go forward 240 years |
638
+ | < kbd > ENTER</ kbd > | Select current year |
631
639
632
640
### Troubleshooting
633
641
0 commit comments