From 6a17235d0a4c8efc0d2f805fbae69edd69b8c66c Mon Sep 17 00:00:00 2001 From: Alexander Guryanov Date: Mon, 5 Oct 2020 13:13:24 +0700 Subject: [PATCH] [BUG](FIX #151): Add workaround for missed pointerremove event when multitouch is disabled --- src/collection.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/collection.js b/src/collection.js index 368fafb..a1dc7df 100644 --- a/src/collection.js +++ b/src/collection.js @@ -259,6 +259,16 @@ Collection.prototype.onstart = function (evt) { self.processOnStart(touch); } } + else if (opts.maxNumberOfNipples === 1 && origEvt.type.match(/^pointer/)) { + Object.keys(self.manager.ids).forEach(function(k){ + var e = [evt[0]]; + e.pointerId = k; + self.processOnEnd(e); + }); + if(self.actives.length < opts.maxNumberOfNipples){ + self.processOnStart(touch); + } + } }; u.map(evt, process);