pnotify icon indicating copy to clipboard operation
pnotify copied to clipboard

Notification not hide when in non focused tab/window

Open edika99 opened this issue 6 years ago • 1 comments

I've notice that notification shown in non focused browser windows, does not hide automatically until the windows/tab is focused again. In my case, I have an application that send notification about some events with a PNotify and a sound. While I'm browsing on other open tabs in Chrome, I can hear the notification arriving by the sound, but when I focus again the tab where the application is running, I find all the PNotifys still shown on the application, even if is is passed a lot of time, and the notification should be expired. Then, after some seconds, all notification starts to hide, in the order that were been show. Does this depends by a browser behaviour or is a PNotify problem?

edika99 avatar Feb 12 '20 15:02 edika99

I have the same problem. It think, that the problem is window.requestAnimationFrame function that pauses when the tab is inactive and resumes after tab is focused

    window.requestAnimationFrame(() => {
      if (_state !== 'opening') {
        reject();
        _openPromise = null;
        return; 
...

lbochen avatar Jul 06 '22 10:07 lbochen