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

Z index is increasing on every close and open action for Dialog component #7041

Open
nileshzala005 opened this issue Aug 13, 2024 · 6 comments
Labels
Type: Bug Issue contains a defect related to a specific component.

Comments

@nileshzala005
Copy link

Describe the bug

Dialog component increasing z-index by 1 on every close and open action. this issue stopped other components(e.g. dropdown list item) from rendering inside the dialog component.
Z-index

Reproducer

https://stackblitz.com/edit/bp4c3k?file=src%2FApp.jsx

System Information

"primereact": "^10.8.2",

Steps to reproduce the behavior

  1. Click on the Show button on the above demo project
  2. Open the developer tool and see the z-index of dialog HTML code, it's increasing on every close and open dialog action

Expected behavior

z-index of dialog HTML code should not increase by 1 on every close and open action

@nileshzala005 nileshzala005 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 13, 2024
@melloware
Copy link
Member

This is by design as every time the dialog opens it must be on top so its z-index is increased. All the PrimeTek libs work the same way.

What is your real issue?

@melloware melloware added Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 13, 2024
@nileshzala005
Copy link
Author

nileshzala005 commented Aug 13, 2024

@melloware When the z-index is reached more than 2103, it does not display dropdowns properly. Please refer to this updated demo
image

Please provide a workaround for this and update the above demo.

@melloware
Copy link
Member

cc @navedqb

@melloware melloware added Status: Discussion Issue or pull request needs to be discussed by Core Team and removed Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior labels Aug 25, 2024
@madalina-agh
Copy link

I'm facing the same issue. I guess that the way it was intended to work was to set the z-index just higher by 1 in relation to the current highest on the page. The actual implementation just keeps growing each Dialog opening by 1, reaching very high values if the page is not refreshed in a while.

@ozziej
Copy link

ozziej commented Oct 7, 2024

Can confirm that this is an issue with drop down items inside a dialog, I can easily reproduce.
Z-index on dialog goes from 2302 -> 4604 but the dropdown stays at z-index of 1001 for the dropdown.

Classes that have the low z-index are :

PrimeReact 10.8.3
Screenshot 2024-10-07 at 14 01 50

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Discussion Issue or pull request needs to be discussed by Core Team labels Oct 7, 2024
@melloware
Copy link
Member

Converted this issue to a BUG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

4 participants