From 4b26ecb89dfd85ea1e5c664b0aedc5c11d41a635 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Sun, 16 Feb 2020 19:13:54 +0100 Subject: [PATCH] Experimental fix attempt in Board.vue (bad behavior on smartphones) --- client/src/components/Board.vue | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/client/src/components/Board.vue b/client/src/components/Board.vue index 8b570952..0c12620b 100644 --- a/client/src/components/Board.vue +++ b/client/src/components/Board.vue @@ -244,19 +244,31 @@ export default { ); elementArray.push(reserves); } - return h( - 'div', - { - // NOTE: click = mousedown + mouseup + let onEvents = {}; + // NOTE: click = mousedown + mouseup + if ('ontouchstart' in window) + { + onEvents = { + on: { + touchstart: this.mousedown, + touchmove: this.mousemove, + touchend: this.mouseup, + }, + }; + } + else + { + onEvents = { on: { mousedown: this.mousedown, mousemove: this.mousemove, mouseup: this.mouseup, -// touchstart: this.mousedown, - touchmove: this.mousemove, -// touchend: this.mouseup, }, - }, + }; + } + return h( + 'div', + onEvents, elementArray ); }, -- 2.44.0