Skip to content

Commit

Permalink
Merge pull request #31 from Ashish-simpleCoder/feature/develop-hooks
Browse files Browse the repository at this point in the history
add changeset version
  • Loading branch information
Ashish-simpleCoder authored Apr 22, 2024
2 parents ac5cc67 + 20c59ec commit 8ac7f4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/moody-pumas-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'classic-react-hooks': minor
---

Update docs and fix logic issues in hooks
5 changes: 3 additions & 2 deletions src/lib/use-combined-key-event-listener/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import React, { useRef } from 'react'
import { useEventListener } from '../use-event-listener'

Expand Down Expand Up @@ -41,9 +42,9 @@ export default function useCombinedKeyEventListener<K extends keyof GlobalEventH
pressedKeysMap.current.pop()
}

useEventListener(document, type, listener, eventOptions, shouldInjectEvent)
useEventListener(document, type, listener, options)

useEventListener(document, 'keyup', clearPressedKey, eventOptions, shouldInjectEvent)
useEventListener(document, 'keyup', clearPressedKey, options)
useEventListener(window, 'blur', () => (pressedKeysMap.current = []), shouldInjectEvent)
useEventListener(window, 'contextmenu', () => (pressedKeysMap.current = []), shouldInjectEvent)
}

0 comments on commit 8ac7f4f

Please sign in to comment.