We recently upgraded an app that was 3+ years old and upgraded to the latest version of this package. We first started using the default events as the list in the documentation matched what we would expect.
However, the actual behavior was different from previous, older versions. Our timeout was not triggering unless we used another app/window. Digging quickly into the code, we quickly found out that focus had been added to the list of default event.
At the very least, we should update the docs to match the code (happy to open a PR for that 😉 ).
But our bigger question is: should focus really be in the default events?
I looked through the issues and I did not find an issue asking for it (very possible I missed it).
The fix for us was pretty easy, we just used DEFAULT_EVENTS (thank you for exporting it...) and simply removed focus from the list that we passed to the useIdleTimeout().
But if the user is on the tab but not doing anything, are they really active?
What happened?
We recently upgraded an app that was 3+ years old and upgraded to the latest version of this package. We first started using the default events as the list in the documentation matched what we would expect. However, the actual behavior was different from previous, older versions. Our timeout was not triggering unless we used another app/window. Digging quickly into the code, we quickly found out that
focus
had been added to the list of default event. At the very least, we should update the docs to match the code (happy to open a PR for that 😉 ). But our bigger question is: shouldfocus
really be in the default events? I looked through the issues and I did not find an issue asking for it (very possible I missed it).The fix for us was pretty easy, we just used
DEFAULT_EVENTS
(thank you for exporting it...) and simply removedfocus
from the list that we passed to theuseIdleTimeout()
. But if the user is on the tab but not doing anything, are they really active?Reproduction Steps
Relevant log output
No response
Screenshots or Additional Context
No response
Module Version
5.7.2
What browsers are you seeing the problem on? Select all that apply.
Firefox, Chrome, Safari, Microsoft Edge, Other
What devices are you seeing the problem on?
Desktop, Mobile, Tablet, Wearable, Other
Verification