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

zIndex of ConfirmDialog is not adaptive (always less by one) #13498

Closed
gitkhartmann opened this issue Aug 14, 2023 · 7 comments · Fixed by #13501
Closed

zIndex of ConfirmDialog is not adaptive (always less by one) #13498

gitkhartmann opened this issue Aug 14, 2023 · 7 comments · Fixed by #13501
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@gitkhartmann
Copy link

Describe the bug

The modal ConfirmDialog opened after a normal modal dialog has a zIndex lower than the normal dialog and is not visible anymore.

Environment

Angular version: 14.2.0
PrimeNG version: 14.2.3

Reproducer

No response

Angular version

14.2.0

PrimeNG version

14.2.3

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

9.1.2

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@gitkhartmann gitkhartmann 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 14, 2023
@dkhrunov
Copy link

Same issue

@SoyDiego
Copy link
Contributor

Can you share a stackblitz, please?

@dkhrunov
Copy link

dkhrunov commented Aug 15, 2023

Demo

Stackblitz

Screenshot 2023-08-15 at 09 06 39

Steps to reproduce

  1. Open sidebar
  2. In the opened sidebar invoke confirm dialog

Expected behavior

  • Since the ConfirmDialog opens after the Sidebar, the ConfirmDialog must be on top of the Sidebar.

Supposed Problem

I deep to styles and source code, and this is what I found out:

ConfirmDialog moveOnTop method call ZIndexUtils.set() util and sets this ConfirmDialog z-indexes styles and his backdrop (current z-index - 1).

And finally wrapper (backdrop) has same z-index (example on the screenshot above = z-index: 1101) the same as the previously opened sidebar z-index (example on the screenshot above = z-index: 1101). This leads to this problem described above.

Dialog modals (Dialog/DynamicDialog/ConfirmDialog components) uses backdrop as wrapper over dialog content. And its own (content) styles for z-index: 1102 overrides by backdrop z-index: 1101.

@dkhrunov
Copy link

I can suggest such a solution - increment the current z-index, which is stored in the ZIndexUtils utility for the Dialog, not by one, but by two points at once, then the backdrop value will be higher than the sidebar value.

@dkhrunov
Copy link

I can suggest such a solution - increment the current z-index, which is stored in the ZIndexUtils utility for the Dialog, not by one, but by two points at once, then the backdrop value will be higher than the sidebar value.

This is what we did in our code to get around this problem, and it works fine.

@SoyDiego
Copy link
Contributor

SoyDiego commented Aug 15, 2023

Hi @dkhrunov, thanks for your examples and explanation.
I did a PR with your solution, you can check here: #13501.
When I have tested the problem, always I saw all perfectly and anything affect the functionality, only I saw the zIndex position repeated like you 1102 but doesn't affect my functionality or I don't know I didn't notice because all was working fine.
Anyway, I did the PR increasing the zIndex to have differents. Now we should wait if PrimeNG Team approve it.
Thanks!

@dkhrunov
Copy link

dkhrunov commented Aug 15, 2023

Hi @dkhrunov, thanks for your examples and explanation. I did a PR with your solution, you can check here: #13501. When I have tested the problem, always I saw all perfectly and anything affect the functionality, only I saw the zIndex position repeated like you 1102 but doesn't affect my functionality or I don't know I didn't notice because all was working fine. Anyway, I did the PR increasing the zIndex to have differents. Now we should wait if PrimeNG Team approve it. Thanks!

Good job 💪 & Thank you !

@cetincakiroglu cetincakiroglu removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 25, 2023
@cetincakiroglu cetincakiroglu added this to the 16.4.0 milestone Sep 25, 2023
@cetincakiroglu cetincakiroglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants