Skip to content

Commit

Permalink
Fixes #17129
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Dec 19, 2024
1 parent 7c39076 commit 2bf8053
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/primeng/src/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import {
absolutePosition,
addClass,
addStyle,
appendChild,
blockBodyScroll,
find,
Expand Down Expand Up @@ -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) {
Expand Down
7 changes: 6 additions & 1 deletion packages/primeng/src/datepicker/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import {
absolutePosition,
addClass,
addStyle,
appendChild,
blockBodyScroll,
find,
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 2bf8053

Please sign in to comment.