From 2bf80532ffcd47180bfea8d420d32c05a867a1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:59:31 +0300 Subject: [PATCH] Fixes #17129 --- packages/primeng/src/calendar/calendar.ts | 5 +++++ packages/primeng/src/datepicker/datepicker.ts | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/primeng/src/calendar/calendar.ts b/packages/primeng/src/calendar/calendar.ts index 28185374e43..6099efb689b 100644 --- a/packages/primeng/src/calendar/calendar.ts +++ b/packages/primeng/src/calendar/calendar.ts @@ -27,6 +27,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { absolutePosition, addClass, + addStyle, appendChild, blockBodyScroll, find, @@ -3172,6 +3173,10 @@ export class Calendar extends BaseComponent implements OnInit, AfterContentInit, if (!this.inline) { this.overlay = event.element; this.overlay?.setAttribute(this.attributeSelector as string, ''); + + const styles = !this.inline ? { position: 'absolute', top: '0', left: '0' } : undefined; + addStyle(this.overlay, styles); + this.appendOverlay(); this.updateFocus(); if (this.autoZIndex) { diff --git a/packages/primeng/src/datepicker/datepicker.ts b/packages/primeng/src/datepicker/datepicker.ts index 45b0537a0bc..548c21eeaf5 100644 --- a/packages/primeng/src/datepicker/datepicker.ts +++ b/packages/primeng/src/datepicker/datepicker.ts @@ -28,6 +28,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { absolutePosition, addClass, + addStyle, appendChild, blockBodyScroll, find, @@ -150,7 +151,7 @@ export const DATEPICKER_VALUE_ACCESSOR: any = { #contentWrapper [attr.id]="panelId" [class]="panelStyleClass" - [ngStyle]="panelStyle" + [style]="panelStyle" [ngClass]="panelClass" [@overlayAnimation]="{ value: 'visible', @@ -3178,6 +3179,10 @@ export class DatePicker extends BaseComponent implements OnInit, AfterContentIni if (!this.inline) { this.overlay = event.element; this.overlay?.setAttribute(this.attributeSelector as string, ''); + + const styles = !this.inline ? { position: 'absolute', top: '0', left: '0' } : undefined; + addStyle(this.overlay, styles); + this.appendOverlay(); this.updateFocus(); if (this.autoZIndex) {