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