Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add baseZIndex and autoZIndex property to Calendar and Dialog #3940

Closed
Abhinav3414 opened this issue Sep 14, 2017 · 11 comments
Closed

Add baseZIndex and autoZIndex property to Calendar and Dialog #3940

Abhinav3414 opened this issue Sep 14, 2017 · 11 comments
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@Abhinav3414
Copy link

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

@SimonGeering
Copy link

I am also able to replicate this issue.

@mx0c
Copy link

mx0c commented Oct 9, 2017

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

@Abhinav3414
Copy link
Author

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;
}

@mx0c
Copy link

mx0c commented Oct 9, 2017

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>

@cagataycivici cagataycivici changed the title Setting z-index on p-calendar on top of p-dialog Add baseZIndex and controlZIndex property to Calendar and Dialog Oct 20, 2017
@cagataycivici cagataycivici self-assigned this Oct 20, 2017
@cagataycivici cagataycivici added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add Type: New Feature Issue contains a new feature or new component request and removed Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add labels Oct 20, 2017
@cagataycivici cagataycivici added this to the 4.2.3 milestone Oct 20, 2017
@cagataycivici cagataycivici changed the title Add baseZIndex and controlZIndex property to Calendar and Dialog Add baseZIndex and autoZIndex property to Calendar and Dialog Oct 23, 2017
@cagataycivici
Copy link
Member

cagataycivici commented Oct 23, 2017

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.

@sgentile
Copy link

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

@leonetosoft
Copy link

leonetosoft commented Jun 3, 2018

@sgentile mesma coisa aqui.

erroprime

@fffaria
Copy link

fffaria commented Dec 3, 2018

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

@tiger5226
Copy link
Contributor

tiger5226 commented Feb 23, 2019

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.

@emregozel
Copy link

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;
}

@Hypenate
Copy link

Hypenate commented Mar 3, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

10 participants