iziToast icon indicating copy to clipboard operation
iziToast copied to clipboard

Close related events called 2 times when overlay is used

Open pawelkania opened this issue 5 years ago • 0 comments

When onClosing or onClosed event is used together with overlay (which can close toast) event is called two times.

Steps to reproduce:

  1. Create two toasts with overlay and overlayClose,
  2. close first notification by clicking "x" button (first "onClosing 1" function executed which is correct)
  3. close second notification by clicking overlay - "onClosing 1" and "onClosing 2" function is executed but only "onClosing 2" should be executed because first toast is already closed.
iziToast.show({
    position: 'center',
    title: 'Hey',
    message: 'Welcome!',
    timeout: false,
    overlay: true,
    overlayClose: true,
    onClosing: function(instance, toast){
    	console.log('onClosing 1', instance);
    }
});

iziToast.show({
    position: 'center',
    title: 'Hey',
    message: 'Welcome!',
    timeout: false,
    overlay: true,
    overlayClose: true,
    onClosing: function(instance, toast){
    	console.log('onClosing 2', instance);
    }
});

Working example is here: https://jsfiddle.net/xjz2qu7e

pawelkania avatar May 23 '19 07:05 pawelkania