Closed fynncfchen closed 6 years ago
I've got the same issue
If I try to use the animation and hover a notice when it closes, the notice remains visible translucent block with the status "closing" and is not removed either from the DOM or from global array notices
. However, this does not happen every time: if at the same time a lot to create and delete notifications, it happens sometimes.
My code:
function foo() {
const ID = 'clickable_link';
new PNotify({
title: 'title',
type: 'info',
text: '<a id=' + ID + '>Click me!</a>',
nonblock: {
nonblock: true,
},
hide: false,
after_open: () => {
const link = document.getElementById(ID);
link.onclick = bar;
return true;
}
});
}
// ...
foo();
PNotify.removeAll(); foo(); // this code evaluated many times
In contrast, if I don't use the animation, everything works as expected: notification is deleted from the DOM and from the global array notices
.
Code:
function foo() {
const ID = 'clickable_link';
new PNotify({
title: 'title',
type: 'info',
text: '<a id=' + ID + '>Click me!</a>',
nonblock: {
nonblock: true,
},
animation: 'none',
hide: false,
after_open: () => {
const link = document.getElementById(ID);
link.onclick = bar;
return true;
}
});
}
// ...
foo();
PNotify.removeAll(); foo(); // this code evaluated many times
I'm not willing to use PNotify anymore
I found that when I open a notice then close it in a very short time, the notice will be hidden but remain on the top of the page.
My code
or just
the notice will stuck on
closing
state and not actually closed.