Fix action handler for touch (#6775)

* Fix action handler for touch

* Console
This commit is contained in:
Bram Kragten 2020-09-03 14:09:25 +02:00 committed by GitHub
parent 6f673359ff
commit 1997e63b7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,13 +150,13 @@ class ActionHandler extends HTMLElement implements ActionHandler {
} }
// Prevent mouse event if touch event // Prevent mouse event if touch event
ev.preventDefault(); ev.preventDefault();
if (
["touchend", "touchcancel"].includes(ev.type) &&
this.timer === undefined
) {
return;
}
if (options.hasHold) { if (options.hasHold) {
if (
["touchend", "touchcancel"].includes(ev.type) &&
this.timer === undefined
) {
return;
}
clearTimeout(this.timer); clearTimeout(this.timer);
this.stopAnimation(); this.stopAnimation();
this.timer = undefined; this.timer = undefined;