iziToast
iziToast copied to clipboard
Close related events called 2 times when overlay is used
When onClosing or onClosed event is used together with overlay (which can close toast) event is called two times.
Steps to reproduce:
- Create two toasts with overlay and overlayClose,
- close first notification by clicking "x" button (first "onClosing 1" function executed which is correct)
- 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