Skip to content

Commit

Permalink
fix(rstream-gestures): touchevent check in safari
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jul 13, 2018
1 parent d636876 commit ee48a94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/rstream-gestures/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ export function gestureStream(el: Element, opts?: Partial<GestureStreamOpts>): S
xform: map((e: MouseEvent | TouchEvent | WheelEvent) => {
let evt, type;
opts.preventDefault && e.preventDefault();
if (e instanceof TouchEvent) {
if ((<TouchEvent>e).touches) {
type = {
"touchstart": GestureType.START,
"touchmove": GestureType.DRAG,
"touchend": GestureType.END,
"touchcancel": GestureType.END
}[e.type];
evt = e.changedTouches[0];
evt = (<TouchEvent>e).changedTouches[0];
} else {
type = {
"mousedown": GestureType.START,
Expand Down

0 comments on commit ee48a94

Please sign in to comment.