Toast shows behind modal

See original GitHub issue

I’m using a modal, with a zIndex of 1000. I have a toast as follows:

toast.error(errorMessage, {
  zIndex: 9999,
  hideProgressBar: true,
  autoClose: 2000,
  position: toast.POSITION.TOP_CENTER,
});

However, the toast shows behind the modal:

omdal

The component hierarchy is:

<Toaster>
  <RootContainer />
</Toaster>

The <Toaster /> component is just a wrapper for <ToastContainer />. The modal is opened in the <RootContainer />.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

12reactions
gvsakhilcommented, Oct 23, 2020

Add this piece of code to fix it

.Toastify__toast-container { z-index: 200000; }

8reactions
mortezashojaeicommented, Aug 10, 2020

I have same problem in modals created by react portal

Read more comments on GitHub >

github_iconTop Results From Across the Web

ngToast message is displaying behind the modal popup
Bootstrap modal has a z-index of 1040, so anything above that should make the toast message appear over the modal.
Read more >
How to show lightning toast on top of modal (quick action)?
Show activity on this post. You can use the lightning:notificationsLibrary and put a notice up over your modal. It's not the same as...
Read more >
How I Can show Toast Message Inside Dialog Or above Dialog?
Toast shown over the dialog overlay.
Read more >
Toasts - Bootstrap
Push notifications to your visitors with a toast, a lightweight and easily customizable alert message. Toasts are lightweight notifications designed to mimic ...
Read more >
[#MDL-70866] Toast is display underneath the modals
btw only changing the z-index of the toast is not enough. If there is a toast on the screen at the moment when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found