From a2218d9ba53d036194cf908477a42a93b4a4ade6 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini <16690124+samelhusseini@users.noreply.github.com> Date: Mon, 26 Feb 2018 13:58:51 -0800 Subject: [PATCH] Fix canvas (screen) user select options to disable selection in Safari, Mozilla, etc. (#348) --- sim/visuals/board.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sim/visuals/board.ts b/sim/visuals/board.ts index ea776291..7fef45ff 100644 --- a/sim/visuals/board.ts +++ b/sim/visuals/board.ts @@ -351,6 +351,10 @@ namespace pxsim.visuals { private buildScreenCanvas() { this.screenCanvas = document.createElement("canvas"); this.screenCanvas.id = "board-screen-canvas"; + this.screenCanvas.style.userSelect = "none"; + this.screenCanvas.style.msUserSelect = "none"; + this.screenCanvas.style.webkitUserSelect = "none"; + (this.screenCanvas.style as any).MozUserSelect = "none"; this.screenCanvas.style.position = "absolute"; this.screenCanvas.addEventListener(pxsim.pointerEvents.up, ev => { this.layoutView.selectBrick();