apvarun / toastify-js

Pure JavaScript library for better notification messages
https://apvarun.github.io/toastify-js/
MIT License
2.09k stars 230 forks source link

Stop the timeout if the window is not focused #112

Open DieterHolvoet opened 1 year ago

DieterHolvoet commented 1 year ago

Fixes #110. This adds a new option, stopOnWindowBlur, that - similarly to the stopOnFocus option - stops the timeout timer if the user navigates away from the page and restarts the timer once the window regains focus. This prevents notifications from disappearing without the user actually having seen it. I set it to be enabled by default.