Skip to content

Commit e6f1a7d

Browse files
authored
fix(material/datepicker): remove div as a child of button (#26838)
Fixes that we had divs as children of buttons which some a11y tools complain about. Fixes #26825.
1 parent 6ad47bf commit e6f1a7d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/material/datepicker/calendar-body.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@
6666
[attr.aria-describedby]="_getDescribedby(item.compareValue)"
6767
(click)="_cellClicked(item, $event)"
6868
(focus)="_emitActiveDateChange(item, $event)">
69-
<div class="mat-calendar-body-cell-content mat-focus-indicator"
69+
<span class="mat-calendar-body-cell-content mat-focus-indicator"
7070
[class.mat-calendar-body-selected]="_isSelected(item.compareValue)"
7171
[class.mat-calendar-body-comparison-identical]="_isComparisonIdentical(item.compareValue)"
7272
[class.mat-calendar-body-today]="todayValue === item.compareValue">
7373
{{item.displayValue}}
74-
</div>
75-
<div class="mat-calendar-body-cell-preview" aria-hidden="true"></div>
74+
</span>
75+
<span class="mat-calendar-body-cell-preview" aria-hidden="true"></span>
7676
</button>
7777
</td>
7878
</tr>

src/material/datepicker/calendar-body.scss

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ $calendar-range-end-body-cell-size:
7676
left: 0;
7777
z-index: 0;
7878
box-sizing: border-box;
79+
display: block;
7980

8081
// We want the range background to be slightly shorter than the cell so
8182
// that there's a gap when the range goes across multiple rows.

0 commit comments

Comments
 (0)