fix: buttons in menu now clickable on mobile (regression)
This commit is contained in:
parent
6dfd8b366d
commit
d55fc2eaf6
1 changed files with 5 additions and 1 deletions
|
|
@ -627,7 +627,11 @@ async function connect(connectOptions: {
|
|||
let virtualClickTimeout
|
||||
let screenTouches = 0
|
||||
let capturedPointer: { id; x; y; sourceX; sourceY; activateCameraMove; time } | null
|
||||
document.body.addEventListener('touchstart', (e) => e.preventDefault(), { passive: false })
|
||||
document.body.addEventListener('touchstart', (e) => {
|
||||
if (isGameActive(true)) {
|
||||
e.preventDefault()
|
||||
}
|
||||
}, { passive: false })
|
||||
registerListener(document, 'pointerdown', (e) => {
|
||||
const clickedEl = e.composedPath()[0]
|
||||
if (!isGameActive(true) || !miscUiState.currentTouch || clickedEl !== cameraControlEl || e.pointerId === undefined) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue