fix(datetime): days of week and spacing buttons are not announced by screen readers (#26813)

resolves #26811
This commit is contained in:
Liam DeBeasi
2023-02-16 15:05:35 -05:00
committed by GitHub
parent 3a64de49db
commit 1a346b6206

View File

@@ -1925,7 +1925,7 @@ export class Datetime implements ComponentInterface {
</ion-buttons>
</div>
</div>
<div class="calendar-days-of-week">
<div class="calendar-days-of-week" aria-hidden="true">
{getDaysOfWeek(this.locale, mode, this.firstDayOfWeek % 7).map((d) => {
return <div class="day-of-week">{d}</div>;
})}
@@ -1973,6 +1973,7 @@ export class Datetime implements ComponentInterface {
const { day, dayOfWeek } = dateObject;
const { isDateEnabled, multiple } = this;
const referenceParts = { month, day, year };
const isCalendarPadding = day === null;
const { isActive, isToday, ariaLabel, ariaSelected, disabled, text } = getCalendarDayState(
this.locale,
referenceParts,
@@ -2011,15 +2012,16 @@ export class Datetime implements ComponentInterface {
data-day-of-week={dayOfWeek}
disabled={isCalDayDisabled}
class={{
'calendar-day-padding': day === null,
'calendar-day-padding': isCalendarPadding,
'calendar-day': true,
'calendar-day-active': isActive,
'calendar-day-today': isToday,
}}
aria-hidden={isCalendarPadding ? 'true' : null}
aria-selected={ariaSelected}
aria-label={ariaLabel}
onClick={() => {
if (day === null) {
if (isCalendarPadding) {
return;
}