From 9ba91a9bfae4336b9a6dee7f8e844fa00076aa07 Mon Sep 17 00:00:00 2001 From: yigitfindikli Date: Wed, 9 Feb 2022 10:59:26 +0300 Subject: [PATCH] Fixed #11040 - PrimeNG Calendar (p-calendar) Loses alignment when positioned at the top of the input and the user clicks in the year/month --- src/app/components/calendar/calendar.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/components/calendar/calendar.ts b/src/app/components/calendar/calendar.ts index 851948918a6..df8531e4e33 100755 --- a/src/app/components/calendar/calendar.ts +++ b/src/app/components/calendar/calendar.ts @@ -912,11 +912,15 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor { switchToMonthView(event) { this.currentView = 'month'; + this.cd.detectChanges(); + this.alignOverlay(); event.preventDefault(); } switchToYearView(event) { this.currentView = 'year'; + this.cd.detectChanges(); + this.alignOverlay(); event.preventDefault(); }