Skip to content

Commit 6da262d

Browse files
author
MPopov
committed
bring back the div and span inside years view and host bind the role,hidden and valuenow
1 parent 2624578 commit 6da262d

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

projects/igniteui-angular/src/lib/calendar/calendar.directives.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ export class IgxCalendarYearDirective {
4848
return this.isCurrentYear;
4949
}
5050

51+
@HostBinding('attr.role')
52+
public get role(): string {
53+
return this.isCurrentYear ? 'spinbutton' : null;
54+
}
55+
56+
@HostBinding('attr.arria-hidden')
57+
public get aHidden(): boolean {
58+
return !this.isCurrentYear;
59+
}
60+
61+
@HostBinding('attr.aria-valuenow')
62+
public get valuenow(): number {
63+
return this.isCurrentYear ? this.date.getFullYear() : null;
64+
}
65+
5166
@HostBinding('attr.tabindex')
5267
public get tabIndex(): number {
5368
return this.isCurrentYear ? 0 : -1;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<div class="igx-calendar__body">
2-
<ul class="igx-calendar__body-column" (wheel)="scroll($event)" (pan)="pan($event)">
3-
<li
2+
<div class="igx-calendar__body-column" (wheel)="scroll($event)" (pan)="pan($event)">
3+
<span
44
[attr.aria-label]="formattedYear(year)"
55
[igxCalendarYear]="year"
66
[date]="date"
77
(onYearSelection)="selectYear($event)"
88
*ngFor="let year of decade; trackBy: yearTracker">
99

1010
{{ formattedYear(year) }}
11-
</li>
12-
</ul>
11+
</span>
12+
</div>
1313
</div>

0 commit comments

Comments
 (0)