marcelodolza / iziToast

Elegant, responsive, flexible and lightweight notification plugin with no dependencies.
https://marcelodolza.github.io/iziToast/
Apache License 2.0
2.61k stars 304 forks source link

Izitoast is blocking page #178

Closed pawelkania closed 5 years ago

pawelkania commented 5 years ago

When using z-index IziToast is blocking whole page.

Steps to reproduce:

  1. Show toast with high z-index,
  2. close iziToast,
  3. after closing <div class="iziToast-wrapper iziToast-wrapper-center" style="z-index: 99999;"></div> is still there - it is fullscreen so whole page is blocked by this overlay.

Closing toast should also remove iziToast-wrapper.

pawelkania commented 5 years ago

In $iziToast.hide changing $toast.parentNode.remove(); to

if (Object.keys(that.children).length === 0) {
    $toast.parentNode.parentNode.remove(); // if last toast remove also wrapper
} else {
   $toast.parentNode.remove(); // if not last leave wrapper
}

will resolve problem.