Skip to content

Commit

Permalink
Prevent mobile from selecting canvas.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-B-Tufvesson committed Dec 31, 2023
1 parent 760a2a9 commit 8611395
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export class Controller {

canvas.addEventListener('mousedown', () => this.onMouseDown())
canvas.addEventListener('mouseup', () => this.onMouseUp())
canvas.addEventListener('touchstart', () => this.onMouseDown())
canvas.addEventListener('touchstart', (event) => {
event.preventDefault()
this.onMouseDown()
})
canvas.addEventListener('touchend', () => this.onMouseUp())
}

Expand Down

0 comments on commit 8611395

Please sign in to comment.