PrimeNG日历打开Z索引错误

Tal*_*lad 4 css primeng primeng-calendar

我正在使用 primeNG 日历,每当日历在输入框下打开时,它都位于所有其他 html 元素之后。但是当它在输入框上方打开时一切正常。

在此处输入图片说明

Tal*_*lad 10

我通过在 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>
Run Code Online (Sandbox Code Playgroud)