Skip to content

Commit 7046a66

Browse files
rkaraivanovCopilot
andauthored
fix(calendar): aria-hidden for days in perfect month (#2079)
* fix(calendar): aria-hidden for days in perfect month When the month is [perfect](https://en.wikipedia.org/wiki/Perfect_month), apply the `aria-hidden` attribute based on whether all days in the week are hidden, not just the edge weeks. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 1cbb10b commit 7046a66

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/components/calendar/days-view/days-view.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -533,18 +533,17 @@ export default class IgcDaysViewComponent extends EventEmitterMixin<
533533

534534
// Pre-compute day properties for all dates to avoid redundant calculations
535535
const dayPropertiesMap = new Map<number, DayProperties>();
536+
536537
for (const day of this._dates) {
537538
dayPropertiesMap.set(day.timestamp, this._getDayProperties(day, today));
538539
}
539540

540541
for (const [idx, week] of weeks.entries()) {
541-
const isEdgeWeek = idx === 0 || idx === lastIndex;
542542
const isLast = idx === lastIndex;
543543

544-
// Only check hidden state for first and last weeks
545-
const hidden =
546-
isEdgeWeek &&
547-
week.every((day) => dayPropertiesMap.get(day.timestamp)!.hidden);
544+
const hidden = week.every(
545+
(day) => dayPropertiesMap.get(day.timestamp)!.hidden
546+
);
548547

549548
yield html`
550549
<div role="row" part="days-row" aria-hidden=${hidden}>

0 commit comments

Comments
 (0)