You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When window gets or loses focus 'blur' and 'focus' event callbacks are not called.
I expect that these will be triggered ifvisible.on('blur', () => console.log('ifvisible blur callback')) ifvisible.on('focus', () => console.log('ifvisible focus callback'))
Standard window events are triggered as expected window.addEventListener('blur', () => console.log('window blur')) window.addEventListener('focus', () => console.log('window focus'))
The text was updated successfully, but these errors were encountered:
visible : the page content may be at least partially visible. In practice this means that the page is the foreground tab of a non-minimized window.
hidden : the page content is not visible to the user. In practice this means that the document is either a background tab or part of a minimized window, or the OS screen lock is active.
Implementation of these events might differ from browser to browser. Clicking outside of the window or switching to a different app while browser is still visible, will not trigger these events.
In the latest version, I've included a new method called ifvisible.legacyMode() if you run this method, it will work like you wanted.
When window gets or loses focus 'blur' and 'focus' event callbacks are not called.
I expect that these will be triggered
ifvisible.on('blur', () => console.log('ifvisible blur callback'))
ifvisible.on('focus', () => console.log('ifvisible focus callback'))
Standard window events are triggered as expected
window.addEventListener('blur', () => console.log('window blur'))
window.addEventListener('focus', () => console.log('window focus'))
The text was updated successfully, but these errors were encountered: