diff --git a/packages/primeng/src/datepicker/datepicker.ts b/packages/primeng/src/datepicker/datepicker.ts index 3631d5d73a..59b2299a5a 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, @@ -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) {