Skip to content

Commit 81e9c9d

Browse files
authored
Merge pull request #8662 from IgniteUI/hanastasov/calendar-fix-11.0.x
Find month element from date value
2 parents f22d367 + 87c6f6e commit 81e9c9d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,13 @@ export class IgxCalendarComponent extends IgxMonthPickerBaseDirective implements
638638
this.activeViewIdx = activeViewIdx;
639639
requestAnimationFrame(() => {
640640
this.monthsView.date = args;
641-
this.focusMonth(event.target);
641+
this.focusMonth();
642642
});
643643
}
644644

645-
private focusMonth(target: HTMLElement) {
645+
private focusMonth() {
646646
const month = this.monthsView.monthsRef.find((e) =>
647-
e.index === parseInt(target.parentElement.attributes['data-month'].value, 10));
647+
e.index === this.monthsView.date.getMonth());
648648
if (month) { month.nativeElement.focus(); }
649649
}
650650

0 commit comments

Comments
 (0)