From 996895268ed87dc3d57703b3d2bf6e930a160c22 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Mon, 21 Oct 2019 11:27:43 +0200 Subject: [PATCH] Hide the emulated cursor when target is null Makes it easier to understand what happens when a real element isn't passed as a target to updateVisibility(). Also makes the code more robust to future changes. Co-authored-by: Alex Tanskanen Co-authored-by: Niko Lehto --- kasmweb/core/util/cursor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kasmweb/core/util/cursor.js b/kasmweb/core/util/cursor.js index be7ce26..0dee4eb 100644 --- a/kasmweb/core/util/cursor.js +++ b/kasmweb/core/util/cursor.js @@ -209,6 +209,9 @@ export default class Cursor { // (i.e. are we over the target, or a child of the target without a // different cursor set) _shouldShowCursor(target) { + if (!target) { + return false; + } // Easy case if (target === this._target) { return true;