PrimeNG 日历打开 Z 索引错误

PrimeNG Calendar open Z index error

我正在使用 primeNG 日历,只要日历在输入框下打开,它就会位于所有其他 html 元素的后面。但是在输入框上面打开的时候一切正常

我通过在 p-calendar html 元素中使用 appendTo="body" 修复了它。

下面是 html 元素现在的样子:

 <p-calendar appendTo="body" [locale]="dk" placeholder="Inklusion dato" [(ngModel)]="patient.inclusionDate" showButtonBar="true"
      readonlyInput="true" [showIcon]="true"></p-calendar>

在我的案例中效果很好。只需添加内联 CSS of

<p-calendar [(ngModel)]="dateTo" [disabledDays]="[0,6]" (onSelect)="doOnSelect($event)" [showIcon]="true" [style]="{'overflow': 'visible', 'z-index': '9999','opacity':'1'}"></p-calendar> 

内联只工作而不是 style.css。