'Noty notification works only when Tab is in focus

I am using Noty library for showing notification in a web page.

That notification is fired with a signalr client callback from server.

What happens is, this notification is shown only when Chrome Tab is in active state. When I move out of that tab into some another tab,and if server message is received via signalr, other code runs fine like RefreshGrid, but noty notification does not come up. It shows when I again focus and switch back to that tab.

How to overcome this?

Following is the code for showing noty notification

HubProxy.client.shownotification = function (msg) {
    RefreshGrid(); //This is working fine whether tab is active or not
    new Noty({
        theme: globaltheme,
        type: msg.TYPE,
        layout: globalposition,
        text: '<i class="bi bi-check-square me-1"></i>' + msg.MESSAGE,
        timeout: globaltimer,
        animation: {
            open: 'animated bounceInRight', // Animate.css class names
            close: 'animated bounceOutRight' // Animate.css class names
        },
        callbacks: {
            afterShow: function () {  }
        }
    }).show();
}


Solution 1:[1]

In general, the visibilityControl option is responsible for disabling this behavior. But why is it not working.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alex T