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
Khalil-Khaled authored Aug 6, 2024
1 parent 512f03d commit d74108b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3069,10 +3069,16 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {
} else if (this.overlay) {
if (this.appendTo) {
if (this.view === 'date') {
this.overlay.style.width = DomHandler.getOuterWidth(this.overlay) + 'px';
this.overlay.style.minWidth = DomHandler.getOuterWidth(this.inputfieldViewChild?.nativeElement) + 'px';
if (!this.overlay.style.width) {
this.overlay.style.width = DomHandler.getOuterWidth(this.overlay) + 'px';
}
if (!this.overlay.style.minWidth) {
this.overlay.style.minWidth = DomHandler.getOuterWidth(this.inputfieldViewChild?.nativeElement) + 'px';
}
} else {
this.overlay.style.width = DomHandler.getOuterWidth(this.inputfieldViewChild?.nativeElement) + 'px';
if (!this.overlay.style.width) {
this.overlay.style.width = DomHandler.getOuterWidth(this.inputfieldViewChild?.nativeElement) + 'px';
}
}

DomHandler.absolutePosition(this.overlay, this.inputfieldViewChild?.nativeElement);
Expand Down

0 comments on commit d74108b

Please sign in to comment.