Skip to content

Commit

Permalink
[Flare] Fix isTouchEvent (facebook#15824)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm authored Jun 4, 2019
1 parent 6b5deee commit cfb79ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-events/src/Press.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,8 @@ function calculateResponderRegion(
}

function isTouchEvent(nativeEvent: Event): boolean {
return Array.isArray((nativeEvent: any).changedTouches);
const changedTouches = ((nativeEvent: any): TouchEvent).changedTouches;
return changedTouches && typeof changedTouches.length === 'number';
}

function getTouchFromPressEvent(nativeEvent: TouchEvent): Touch {
Expand Down

0 comments on commit cfb79ee

Please sign in to comment.