Skip to content

Commit

Permalink
fix(rstream-gestures): use correct event var
Browse files Browse the repository at this point in the history
- for some reason used global `event` instead of actual `e`
  • Loading branch information
postspectacular committed Sep 27, 2020
1 parent be7e040 commit 6c7c0a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/rstream-gestures/src/gesture-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ export const gestureStream = (
? GestureType.DRAG
: GestureType.MOVE
: eventGestureTypeMap[etype];
let isTouch = !!(<TouchEvent>event).touches;
let isTouch = !!(<TouchEvent>e).touches;
let events: Array<Touch | MouseEvent | WheelEvent> = isTouch
? Array.from((<TouchEvent>event).changedTouches)
: [<MouseEvent | WheelEvent>event];
? Array.from((<TouchEvent>e).changedTouches)
: [<MouseEvent | WheelEvent>e];
const b = el.getBoundingClientRect();

const getPos = (e: Touch | MouseEvent | WheelEvent) => {
Expand Down Expand Up @@ -188,7 +188,7 @@ export const gestureStream = (
return {
event: e,
pos: getPos(events[0]),
buttons: isTouch ? active.length : (<MouseEvent>event).buttons,
buttons: isTouch ? active.length : (<MouseEvent>e).buttons,
type,
active,
zoom,
Expand Down

0 comments on commit 6c7c0a9

Please sign in to comment.