Skip to content

Commit

Permalink
fix "TouchEvent is not defined"
Browse files Browse the repository at this point in the history
  • Loading branch information
klevron committed Apr 29, 2021
1 parent 80c9ab4 commit 2699ce8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/usePointer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ export default function usePointer(options: PointerConfigInterface): PointerInte

function updatePosition(event: TouchEvent | MouseEvent) {
let x, y
if (event instanceof TouchEvent && event.touches && event.touches.length > 0) {
// @ts-ignore
if (event.touches && event.touches.length > 0) {
x = (<TouchEvent>event).touches[0].clientX
y = (<TouchEvent>event).touches[0].clientY
} else {
Expand Down

0 comments on commit 2699ce8

Please sign in to comment.