I'm using 4.5.2 version, and setting pauseOnFocusLoss to false, is not working as expected. I tried both on ToastContainer and on toast(), for both couldn't make it work. Can you please, help me with that?
Hi, @fkhadra thank you for your response. The thing is that the autoclose timer keeps working on window blur, but when I go back to my window again I can see how the toaster moves to right (the transition). Is there a way not show that as well?
Do you trigger window.blur programmatically ?
no
the thing is that let's say you have toasters opened with 3s autoClose, and you go to another tab and then you come back after 5 seconds and you can see all those 10 toasters for ~500ms and then they disappear. Can you please tell, is there a way to avoid that?
Hello @Ggayane,
I have miss read your question. I just saw that in your case pauseOnFocusLoss is set to false.
Why it happens? To dismiss the toast the onTransitionEnd event is used. When you switch tab onTransitionEnd is not called with chrome or safari, this is a known bug. The issue is solved with firefox
How to avoid that:
pauseOnFocusLoss : but you don't want thatwindow.addEventListener("blur", () => {
toast.dismiss();
});
thanks a lot, this worked!
Most helpful comment
Hello @Ggayane,
I have miss read your question. I just saw that in your case
pauseOnFocusLossis set to false.Why it happens? To dismiss the toast the
onTransitionEndevent is used. When you switch tabonTransitionEndis not called with chrome or safari, this is a known bug. The issue is solved with firefoxHow to avoid that:
pauseOnFocusLoss: but you don't want that