Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/components/calendar/calendar-rendering.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ describe('Calendar Rendering', () => {
await expect(calendar).shadowDom.to.be.accessible();
});

it('passes the a11y audit when a week of hidden days is rendered - issue #1636', async () => {
const aprilFirst2025 = new CalendarDay({ year: 2025, month: 3, date: 1 });
calendar.activeDate = aprilFirst2025.native;
calendar.visibleMonths = 2;
await elementUpdated(calendar);

await expect(calendar).dom.to.be.accessible();
await expect(calendar).shadowDom.to.be.accessible();
});

it('renders the calendar successfully', async () => {
const today = CalendarDay.today.native;
const day = new Intl.DateTimeFormat('en', { weekday: 'short' }).format(
Expand Down
6 changes: 5 additions & 1 deletion src/components/calendar/days-view/days-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,12 @@ export default class IgcDaysViewComponent extends EventEmitterMixin<
const last = weeks.length - 1;

for (const [idx, week] of weeks.entries()) {
let hidden = false;
if (idx === 0 || idx === last) {
hidden = week.every((day) => this.getDayProperties(day, today).hidden);
}
yield html`
<div role="row" part="days-row">
<div role="row" part="days-row" aria-hidden=${hidden}>
${this.showWeekNumbers
? this.renderWeekNumber(week[0], idx === last)
: nothing}
Expand Down