Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ReactCompareImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@
const rect = containerRef.current.getBoundingClientRect()
let clientX: number
let clientY: number
if (e instanceof TouchEvent) {
if (window.TouchEvent && e instanceof TouchEvent) {
const touch = e.touches[0]
invariant(touch)
clientX = touch.clientX
clientY = touch.clientY
} else {
clientX = e.clientX

Check failure on line 143 in src/ReactCompareImage.tsx

View workflow job for this annotation

GitHub Actions / basic-tests

Property 'clientX' does not exist on type 'MouseEvent | TouchEvent'.
clientY = e.clientY

Check failure on line 144 in src/ReactCompareImage.tsx

View workflow job for this annotation

GitHub Actions / basic-tests

Property 'clientY' does not exist on type 'MouseEvent | TouchEvent'.
}
const position = horizontal ? clientX - rect.left : clientY - rect.top

Expand Down
Loading