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

Only start the countdown timer if the page is visible #110

Open DieterHolvoet opened 1 year ago

DieterHolvoet commented 1 year ago

Actual behaviour

I'm using this library with the Drupal module. This module shows messages e.g. after saving a page. It happens often that I save the page and while waiting for the new page to load, I navigate to another tab. Once I come back to the previous tab where the toast appeared, I notice that the toast has already disappeared.

Expected behaviour

Only start the countdown timer if the tab where the toast appears is open. This way, no messages can be missed. Could be made an option instead of the default behaviour.