Skip to content

Commit

Permalink
fix: d2l-calendar > Use more semantic elements and roles (#3700)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswklassen committed Jun 21, 2023
1 parent ffdfcb8 commit 47e89bb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions components/calendar/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,7 @@ class Calendar extends LocalizeCoreElement(RtlMixin(LitElement)) {
const month = day.getMonth();
const date = day.getDate();
const weekday = calendarData.descriptor.calendar.days.long[calendarData.daysOfWeekIndex[index]];
const description = `${weekday} ${date}. ${selected ? this.localize(`${this._namespace}.selected`) : this.localize(`${this._namespace}.notSelected`)} ${formatDate(day, { format: 'monthYear' })}`;
// role="gridcell" used for screen reader (e.g., JAWS and VoiceOver) behavior to work properly
const description = `${weekday} ${date} ${formatDate(day, { format: 'monthYear' })}`;
return html`
<td
aria-selected="${selected ? 'true' : 'false'}"
Expand Down Expand Up @@ -519,7 +518,7 @@ class Calendar extends LocalizeCoreElement(RtlMixin(LitElement)) {
icon="tier1:chevron-right">
</d2l-button-icon>
</div>
<table aria-labelledby="${labelId}" role="presentation">
<table aria-labelledby="${labelId}">
${summary}
<thead aria-hidden="true">
<tr>${weekdayHeaders}</tr>
Expand Down

0 comments on commit 47e89bb

Please sign in to comment.