primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Add baseZIndex and autoZIndex property to Calendar and Dialog

Open Abhinav3414 opened this issue 9 years ago • 11 comments

I'm submitting a ...

[x] bug report => Search github for a similar issue or PR before submitting

Current behavior

I am using modal dialogue and p-calendar inside it, but due to incremental z-index feature of primeNG, calendar goes in background as I click on modal's input field of p-calendar. Is there any fix provided by PrimeNG on this, other than setting z-index manually (at a higher value) to DOM handle.?

Expected behavior

My requirement is that when the calendar component is still active, and I click inside input field of calendar, Calendar should not go back of modal. It should remain at higher z-index than p-dialog.

Environments: Windows 10, Eclipse Neon.3 Release (4.6.3)

latest 4 x of angular and prime

Abhinav3414 avatar Sep 14 '17 09:09 Abhinav3414

I am also able to replicate this issue.

SimonGeering avatar Oct 08 '17 10:10 SimonGeering

How do i fix this problem? If i set the Z-Index manually nothing happens...

mx0c avatar Oct 09 '17 08:10 mx0c

Not a permanent or not a standard solution, but I am using important tag for now, as a work around. .ui-datepicker { z-index: 100000 !important; }

Abhinav3414 avatar Oct 09 '17 10:10 Abhinav3414

Thanks for your reply! Fixed it now like this: <p-calendar placeholder="endDate" [showIcon]="true" [style]="{'position': 'fixed', 'overflow': 'visible', 'z-index': '999'}" [(ngModel)]="endDate"></p-calendar>

mx0c avatar Oct 09 '17 11:10 mx0c

To disable automatic layering, set [autoZIndex]="false", if you want to keep it but want to use a different higher value then 1000 use [baseZIndex]="100000". If autoZIndex is true then when calendar is displayed zIndex would be 100001. Applies to 4.2.3. Dialog also has this, so you can manage it manually properly without your values being overwritten now.

cagataycivici avatar Oct 23 '17 08:10 cagataycivici

This should not have been marked as fixed - it isn't fixed:

image

div *ngSwitchCase="StartDate'">
              <p-calendar [autoZIndex]="false" [baseZIndex]="9999"  [showIcon]="true"></p-calendar>
            </div>

It is hidden by the p-table - no matter what I set the baseZIndex it is still 'hidden' by the table header

sgentile avatar Apr 12 '18 13:04 sgentile

@sgentile mesma coisa aqui.

erroprime

leonetosoft avatar Jun 03 '18 06:06 leonetosoft

I still have the bug like the others, no matter what solutions I use that were suggested here. bug1

fffaria avatar Dec 03 '18 18:12 fffaria

Yeah, I have the problem too...

screen shot 2019-02-22 at 8 34 12 pm

It just really sucks when you can use the library so easily and then you run into something like this without a way to fix it.

UPDATE:

I found a few things to use.

<input pInputText id="start" type="datetime-local"
               [ngModel]="file.Start | date:'yyyy-MM-ddTHH:mm:ss'"
               (ngModelChange)="file.Start = getDate($event)" />

the getDate is just a ts method created to return Date. It produces the following:

screen shot 2019-02-22 at 9 13 01 pm

Then I also discovered that if you use the appendTo="body" you get this:

screen shot 2019-02-22 at 9 30 29 pm

Hopefully this helps others that arrive here.

tiger5226 avatar Feb 23 '19 01:02 tiger5226

I have a quick fix. If you are using dialog component fix this CSS with calendar crop problem.

::ng-deep .ui-dialog-resizable .ui-dialog-content {
    overflow: unset;
}

emregozel avatar Jul 15 '19 20:07 emregozel

I added appendTo="body" to get it to work.

Hypenate avatar Mar 03 '22 19:03 Hypenate