Skip to content

Commit

Permalink
Fixed #16176 - Calendar | add checks on panelStyle width and min-widt…
Browse files Browse the repository at this point in the history
…h before applying alignOverlay styles
  • Loading branch information
mehmetcetin01140 committed Nov 12, 2024
1 parent cba6c73 commit f9fccc2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/primeng/src/datepicker/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3168,12 +3168,17 @@ export class DatePicker extends BaseComponent implements OnInit, OnDestroy, Cont
} else if (this.overlay) {
if (this.appendTo) {
if (this.view === 'date') {
this.overlay.style.width = getOuterWidth(this.overlay) + 'px';
this.overlay.style.minWidth = getOuterWidth(this.inputfieldViewChild?.nativeElement) + 'px';
if (!this.overlay.style.width) {
this.overlay.style.width = getOuterWidth(this.overlay) + 'px';
}
if (!this.overlay.style.minWidth) {
this.overlay.style.minWidth = getOuterWidth(this.inputfieldViewChild?.nativeElement) + 'px';
}
} else {
this.overlay.style.width = getOuterWidth(this.inputfieldViewChild?.nativeElement) + 'px';
if (!this.overlay.style.width) {
this.overlay.style.width = getOuterWidth(this.inputfieldViewChild?.nativeElement) + 'px';
}
}

absolutePosition(this.overlay, this.inputfieldViewChild?.nativeElement);
} else {
relativePosition(this.overlay, this.inputfieldViewChild?.nativeElement);
Expand Down

0 comments on commit f9fccc2

Please sign in to comment.