Closed merkancam closed 3 years ago
Would be great if you could reproduce this issue. I tried by generating multiple toasts and it works as intended. Reference: https://jsbin.com/mikekeqiqi/2/edit?html,js,output
@apvarun Reproduced Issue: https://jsbin.com/minaziyuve/edit?html,js,output It happens when we store the options on a js variable and trigger it on a mouse event.
@Illusionist3886 This is related to how the library is designed. Each toast is expected to have its own instance. Create multiple toasts from one config is not the intended one.
Each toast is expected to have its own instance.
This is setup as such in order to have each of them controllable from JS
In order to achieve what you need, the following small changes could help
myToast = Toastify({
to myToast = () => Toastify({
myToast.showToast()
to myToast().showToast()
Reference bin: https://jsbin.com/rafixuw/edit?html,js,output
Closing this due to inactivity
If I show one message it disappears. No problem but if i show multiple messages then only first one disappears rest are keeps alive.
here is my message below
toast.lib.init({ text: message, duration: 3000, newWindow: false, close: true, gravity: "top", position: 'right', backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)", stopOnFocus: true, }).showToast();