From 09429d0dc93e66fadc4d6a5130b218ff1f0ccda5 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 3 Apr 2024 14:53:22 -0400 Subject: [PATCH] fix: add touch input text element --- src/html/index.html | 9 +++++++++ src/js/jagex2/client/GameShell.ts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/html/index.html b/src/html/index.html index fa6427dc..619821cc 100644 --- a/src/html/index.html +++ b/src/html/index.html @@ -31,9 +31,18 @@ -webkit-tap-highlight-color: rgba(255, 255, 255, 0); z-index: -1; } + + #touchInput { + position: absolute; + top: 0; + left: 0; + opacity: 0; /* Make the input element transparent */ + pointer-events: none; /* Disable pointer events on the input element */ + } + \ No newline at end of file diff --git a/src/js/jagex2/client/GameShell.ts b/src/js/jagex2/client/GameShell.ts index 9ec30a55..5d31ad20 100644 --- a/src/js/jagex2/client/GameShell.ts +++ b/src/js/jagex2/client/GameShell.ts @@ -586,7 +586,7 @@ export default abstract class GameShell { this.touching = false; return; } else if (this.insideChatInputArea() || this.insideChatPopupArea() || this.insideUsernameArea() || this.inPasswordArea()) { - if (this.touchInput !== null && this.touchInput.parentNode?.contains(this.touchInput)) { + if (this.touchInput !== null) { this.touchInput.parentNode?.removeChild(this.touchInput); this.touchInput = null; }