Skip to content

Commit 4ff59bc

Browse files
committed
fix(igxMonthPicker): should not throw error when press and pgDown #8074
1 parent 07749c4 commit 4ff59bc

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
@@ -196,6 +196,7 @@ export class IgxMonthPickerComponent extends IgxMonthPickerBaseDirective {
196196
@HostListener('keydown.pageup', ['$event'])
197197
public previousYear(event?: KeyboardEvent) {
198198
event?.preventDefault();
199+
if (this.yearAction === 'next') { return; }
199200
this.yearAction = 'prev';
200201
this.viewDate = this.calendarModel.getPrevYear(this.viewDate);
201202
}
@@ -206,6 +207,7 @@ export class IgxMonthPickerComponent extends IgxMonthPickerBaseDirective {
206207
@HostListener('keydown.pagedown', ['$event'])
207208
public nextYear(event?: KeyboardEvent) {
208209
event?.preventDefault();
210+
if (this.yearAction === 'prev') { return; }
209211
this.yearAction = 'next';
210212
this.viewDate = this.calendarModel.getNextYear(this.viewDate);
211213
}

0 commit comments

Comments
 (0)