notyf
notyf copied to clipboard
[Feature Request] No stacking notifications
First of all, this notification project is very easy to use and pretty CSS. I just started using it for my project.
I just have one feature that I want to have is, not stacking the notifications. When there is a new notification, I want to replace the current notification and display a new one.
Workaround for this feature is using dismissAll()
, but it still makes stacking notifications before dismissing an old notification.
Demo: https://jsfiddle.net/2jg0wv4m/
Is there an alternative way to replace opened notification?
Hi @caroso1222
I actually updated your code to have a new option maxStack
.
Could you take a look?
https://github.com/caroso1222/notyf/pull/105
Thanks for bringing this to my attention, @chrisleekr. A few things come to my mind:
- What happens when you want to launch a new notification after the max stack has been reached? does notyf show it, or dismiss it?
- Can you please update the jsfiddle? I see it empty
@caroso1222
What happens when you want to launch a new notification after the max stack has been reached? does notyf show it, or dismiss it?
- I found simply removing the last notification from the DOM works as expected. And then display a new notification.
- https://github.com/caroso1222/notyf/pull/105/files#diff-4b2fa43eb39ef49cb0f3bf51b34c98414b01e75f395e92f1a85afde93bf54aefR90
Can you please update the jsfiddle? I see it empty
- Oh, whoops. I forgot what I wrote at that time. But doesn't really matter because PR would explain what I wanted.
Hi,
There is any method that clear all before show new notification (or a parameter)?
Thanks.