We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e49735 commit 308f74dCopy full SHA for 308f74d
packages/client/composables/useHideCursorIdle.ts
@@ -17,17 +17,30 @@ export function useHideCursorIdle(
17
document.body.style.cursor = ''
18
}
19
20
- // If disabled, immediately show the cursor
+ let timer: ReturnType<typeof setTimeout> | null = null
21
+
22
+ // If disabled, immediately show the cursor and stop the timer
23
watch(
24
shouldHide,
25
(value) => {
- if (!value)
26
+ if (!value) {
27
show()
28
+ if (timer) {
29
+ clearTimeout(timer)
30
+ }
31
+ timer = null
32
33
},
34
)
- onScopeDispose(show)
35
- let timer: ReturnType<typeof setTimeout> | null = null
36
+ onScopeDispose(() => {
37
+ show()
38
39
40
41
42
+ })
43
44
useEventListener(
45
document.body,
46
['pointermove', 'pointerdown'],
0 commit comments