-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Toast autoZIndex not working correctly #6825
Comments
You need to give baseZIndex. |
This wasn't a help request! This is definitely an issue. I'm reading the source code before reporting such issues, and believe me, I know what I'm doing.
But anyway the name I solved this issue currently in my app using a wrapper component and a workaround: @ViewChild(Toast)
toast: Toast;
ngDoCheck() {
if (!(this.toast && this.toast.containerViewChild)) return;
const requiredZIndex = `${DomHandler.zindex}`;
const el = this.toast.containerViewChild.nativeElement as HTMLElement;
if (el.style.zIndex !== requiredZIndex) el.style.zIndex = requiredZIndex;
} The code above ensures that the But I think this logic should be in the So please re-open this issue. |
+1 |
i have issue that, but now, i want fixed them... |
Same problem still persists |
still persists on v14.2.3 |
I too have this issue. |
In my case, what @ribizli said was exactly the issue, but I had to set the zIndex to a value higher than the required zIndex for the toast to appear above my dialog. Namely:
I'm not that experienced in CSS properties manipulating, so I am unaware of whether providing values higher than the required zIndex might have side-effects. |
So this is not fixed, toasts are being displayed behind the dialogs overlay even if we declare the toast's z-base-index. Why this hasn't been fixed even tho its been identified years ago is beyond me. |
I'm submitting a ...
Plunkr Case (Bug Reports)
https://stackblitz.com/edit/primeng-toast-autozindex
Current behavior
The toast's
zIndex
is set only once after view init. Every time a modal dialog is opened, theDomHandler.zindex
is increased and the dialog mask gets a higherzIndex
as our toast was set initially. So every toast messages are overlaid, which is not the desired behavior.Expected behavior
Increment toast
zIndex
to not be overlaid by dialog mask.Minimal reproduction of the problem with instructions
See above.
A possible solution could be to implement the
ngDoCheck
lifecycle method to increase the zIndex if needed. (I'm not fully sure about the negative performance impacts of this)The source code hasn't change in this regard since then.
zIndex
must be supported in all browsers in the same way.The text was updated successfully, but these errors were encountered: