mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(datetime): days of week and spacing buttons are not announced by screen readers (#26813)
resolves #26811
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user