From 103314c04869d32dd53afe3f7753affd94a69ec6 Mon Sep 17 00:00:00 2001 From: joni <johnfshaughnessy@gmail.com> Date: Wed, 9 May 2018 14:12:25 -0700 Subject: [PATCH] Fix filter for touches on touchend --- src/components/cursor-controller.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/cursor-controller.js b/src/components/cursor-controller.js index a66fd059b..6183eb666 100644 --- a/src/components/cursor-controller.js +++ b/src/components/cursor-controller.js @@ -312,7 +312,7 @@ AFRAME.registerComponent("cursor-controller", { !this.isMobile || this.hasPointingDevice || !this.activeTouch || - e.touches.some(touch => touch.identifier === this.activeTouch.identifier) + this.some(e.touches, touch => touch.identifier === this.activeTouch.identifier) ) { return; } @@ -443,5 +443,12 @@ AFRAME.registerComponent("cursor-controller", { } else { this.controller = null; } + }, + + some: function(a, fn) { + for (let i = 0; i < a.length; a++) { + if (fn(a[i])) return true; + } + return false; } }); -- GitLab