-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way for the use to be considered idle when the web page loses focus? ⚡️ #385
Comments
Just add the blur event to the events prop. |
Ah, I see. Cool! I tried with this code:
The problem is that on the page I would like to give 30seconds before becoming idle. However, when one defocuses the app, I would want that it goes automatically in idle. How would you do taht? |
The events prop needs to be an array. Try this as the value.
|
Oh you want them to immediately go idle? You can use useIdleTimer({
onIdle,
onActive,
immediateEvents: ['blur'],
timeout: 30_000,
throttle: 500,
}); |
Nice! So basically, it will timeout after 30s of inactivity while in focus, or immediately on blur. This is what I wanted indeed! |
That's correct! Feel free to close if this solves your issue! |
The following does not work :(
|
I'm hoping for a similar use case and have tried the suggestions of @SupremeTechnopriest. When a tab is unfocused, I want it do go idle, however |
What problem does your feature request solve?
from the app's POV, the fact that the user is not on the page anymore it is the same as being idle. Or?
Describe the solution you are proposing.
stop the counter on blur event?
Describe alternatives you have considered.
implementing it on my own, but it's less nice.
Importance
I Need It
Additional Context
The text was updated successfully, but these errors were encountered: