From 98f149990956bca9ced09c22b29a37ab849b9896 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Wed, 8 Apr 2020 20:41:27 +0200
Subject: [PATCH] Fix tooltips removal on smartphone

---
 client/src/views/Game.vue | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue
index 6d506c5f..fa5a86d6 100644
--- a/client/src/views/Game.vue
+++ b/client/src/views/Game.vue
@@ -1208,15 +1208,17 @@ export default {
         game
       );
       if ("ontouchstart" in window) {
-        this.$nextTick(() => {
-          // Disable tooltips on smartphones:
-          document.querySelectorAll("#aboveBoard .tooltip").forEach(elt => {
-
-alert(elt);
-
-            elt.classList.remove("tooltip");
-          });
-        });
+        // TODO: I don't like this timeout, but $nextTick() fails,
+        // and in mounted() hook that fails too.
+        setTimeout(
+          () => {
+            // Disable tooltips on smartphones:
+            document.querySelectorAll("#aboveBoard .tooltip").forEach(elt => {
+              elt.classList.remove("tooltip");
+            });
+          },
+          750
+        );
       }
       this.$refs["basegame"].re_setVariables(this.game);
       if (!this.gameIsLoading) {
-- 
2.44.0