Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close related events called 2 times when overlay is used #176

Open
pawelkania opened this issue May 23, 2019 · 0 comments
Open

Close related events called 2 times when overlay is used #176

pawelkania opened this issue May 23, 2019 · 0 comments

Comments

@pawelkania
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant