marcelodolza / iziToast

Elegant, responsive, flexible and lightweight notification plugin with no dependencies.

Home Page:http://izitoast.marcelodolza.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Izitoast is blocking page

pawelkania opened this issue · comments

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.

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.