Skip to content

Commit

Permalink
[BUG](FIX yoannmoinet#151): Add workaround for missed pointerremove e…
Browse files Browse the repository at this point in the history
…vent when multitouch is disabled
  • Loading branch information
caiiiycuk committed Oct 5, 2020
1 parent 6266f35 commit 6a17235
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6a17235

Please sign in to comment.