Skip to content

Commit

Permalink
fix: add touch input text element
Browse files Browse the repository at this point in the history
  • Loading branch information
ultraviolet-jordan committed Apr 3, 2024
1 parent 16d4927 commit 09429d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
</style>
</head>
<body>
<canvas id="canvas" width="789" height="532"></canvas>
<input type="text" id="touchInput" />
</body>
</html>
2 changes: 1 addition & 1 deletion src/js/jagex2/client/GameShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 09429d0

Please sign in to comment.