File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
< table class ="mat-calendar-table " role ="presentation ">
2
2
< thead class ="mat-calendar-table-header ">
3
- < tr > < th *ngFor ="let day of _weekdays " [attr.aria-label] ="day.long "> {{day.narrow}}</ th > </ tr >
3
+ < tr >
4
+ < th scope ="col " *ngFor ="let day of _weekdays " [attr.aria-label] ="day.long "> {{day.narrow}}</ th >
5
+ </ tr >
4
6
< tr > < th class ="mat-calendar-table-header-divider " colspan ="7 " aria-hidden ="true "> </ th > </ tr >
5
7
</ thead >
6
8
< tbody mat-calendar-body
Original file line number Diff line number Diff line change @@ -103,6 +103,18 @@ describe('MatMonthView', () => {
103
103
expect ( table . getAttribute ( 'role' ) ) . toBe ( 'presentation' ) ;
104
104
} ) ;
105
105
106
+ it ( 'should set the correct scope on the table headers' , ( ) => {
107
+ const nonDividerHeaders = monthViewNativeElement . querySelectorAll (
108
+ '.mat-calendar-table-header th:not(.mat-calendar-table-header-divider)' ) ;
109
+ const dividerHeader =
110
+ monthViewNativeElement . querySelector ( '.mat-calendar-table-header-divider' ) ! ;
111
+
112
+ expect ( Array . from ( nonDividerHeaders ) . every ( header => {
113
+ return header . getAttribute ( 'scope' ) === 'col' ;
114
+ } ) ) . toBe ( true ) ;
115
+ expect ( dividerHeader . hasAttribute ( 'scope' ) ) . toBe ( false ) ;
116
+ } ) ;
117
+
106
118
describe ( 'calendar body' , ( ) => {
107
119
let calendarBodyEl : HTMLElement ;
108
120
let calendarInstance : StandardMonthView ;
You can’t perform that action at this time.
0 commit comments