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
I have verified that I use latest version of all @mantine/* packages
What version of @mantine/* packages do you have in package.json?
7.12.1
What package has an issue?
@mantine/hooks
What framework do you use?
Vite
In which browsers you can reproduce the issue?
All
Describe the bug
The useIdle hook does not start its timer until after the first event occurs. For example, with the code below, if there are no click or keypress events after the page loads, idle will never be true.
…r did non interact with the page (#6683)
* [@mantine/hooks] use-idle: Start timer immediately instead of waiting for an event (#6682)
* [@mantine/hooks] use-idle: Fix test formatting (#6682)
---------
Co-authored-by: Bill Parrott <bill.parrott@prescryptive.com>
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.12.1
What package has an issue?
@mantine/hooks
What framework do you use?
Vite
In which browsers you can reproduce the issue?
All
Describe the bug
The
useIdle
hook does not start its timer until after the first event occurs. For example, with the code below, if there are no click or keypress events after the page loads,idle
will never be true.I found one report of this in Discord, but it was posted in November 2023 and has no replies to the initial posting.
If possible, include a link to a codesandbox with a minimal reproduction
https://codesandbox.io/p/sandbox/useidle-mantine-bug-tx5znz?file=%2Fsrc%2FApp.tsx
Possible fix
Start the timer immediately in the
useIdle
hook instead of waiting for an event first.Self-service
The text was updated successfully, but these errors were encountered: