Skip to content

Commit

Permalink
fix(ui5-calendar): adjust aria-disabled attribute (#9732) (#9734)
Browse files Browse the repository at this point in the history
Fixes: #9719
  • Loading branch information
unazko authored Aug 27, 2024
1 parent 86e8152 commit 8cea6e8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/main/src/DayPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class DayPicker extends CalendarPart implements ICalendarPicker {
classes: `ui5-dp-item ui5-dp-wday${dayOfTheWeek}`,
ariaLabel,
ariaSelected: String(isSelected || isSelectedBetween),
ariaDisabled: isOtherMonth ? "true" : undefined,
ariaDisabled: isDisabled || isOtherMonth ? "true" : undefined,
disabled: isDisabled,
type: specialDayType,
};
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/MonthPicker.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
class="{{this.classes}}"
role="gridcell"
aria-selected="{{this.ariaSelected}}"
aria-disabled="{{this.ariaDisabled}}"
>
<span class="ui5-dp-monthtext">
{{this.name}}
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/MonthPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type Month = {
name: string,
nameInSecType: string,
disabled: boolean,
ariaDisabled: string | undefined,
classes: string,
}

Expand Down Expand Up @@ -166,6 +167,7 @@ class MonthPicker extends CalendarPart implements ICalendarPicker {
name: monthsNames[i],
nameInSecType: this.hasSecondaryCalendarType && this._getDisplayedSecondaryMonthText(timestamp).text,
disabled: isDisabled,
ariaDisabled: isDisabled ? "true" : undefined,
classes: "ui5-mp-item",
};

Expand Down
1 change: 1 addition & 0 deletions packages/main/src/YearPicker.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
class="{{this.classes}}"
role="gridcell"
aria-selected="{{this.ariaSelected}}"
aria-disabled="{{this.ariaDisabled}}"
>
<span>
{{this.year}}
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/YearPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type Year = {
year: string;
yearInSecType: string | undefined;
disabled: boolean;
ariaDisabled: string | undefined;
classes: string;
}

Expand Down Expand Up @@ -176,6 +177,7 @@ class YearPicker extends CalendarPart implements ICalendarPicker {
year: oYearFormat.format(tempDate.toLocalJSDate()),
yearInSecType: textInSecType,
disabled: isDisabled,
ariaDisabled: isDisabled ? "true" : undefined,
classes: "ui5-yp-item",
};

Expand Down

0 comments on commit 8cea6e8

Please sign in to comment.