Skip to content

Commit f8f3c39

Browse files
committed
fix(igxMonthPicker): should not throw error when press and pgDown #8074
1 parent 85fc9ec commit f8f3c39

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ export class IgxMonthPickerComponent extends IgxMonthPickerBaseDirective {
211211
@HostListener('keydown.pageup', ['$event'])
212212
public previousYear(event?: KeyboardEvent) {
213213
event?.preventDefault();
214+
if (this.yearAction === 'next') { return; }
214215
this.yearAction = 'prev';
215216
this.previousViewDate = this.viewDate;
216217
this.viewDate = this.calendarModel.getPrevYear(this.viewDate);
@@ -222,6 +223,7 @@ export class IgxMonthPickerComponent extends IgxMonthPickerBaseDirective {
222223
@HostListener('keydown.pagedown', ['$event'])
223224
public nextYear(event?: KeyboardEvent) {
224225
event?.preventDefault();
226+
if (this.yearAction === 'prev') { return; }
225227
this.yearAction = 'next';
226228
this.previousViewDate = this.viewDate;
227229
this.viewDate = this.calendarModel.getNextYear(this.viewDate);

0 commit comments

Comments
 (0)