From 1522b687376cc322f267bd59e6639ab90df3862a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Wed, 21 Sep 2016 10:42:56 -0400 Subject: [PATCH] gl2d: add user-select-none class to canvas - this sanitizes double clicks interactions - e.g. double-click on the canvas now no longer puts the select-box in a weird state - see https://github.com/plotly/plotly.js/issues/744 for more info --- src/plots/gl2d/scene2d.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plots/gl2d/scene2d.js b/src/plots/gl2d/scene2d.js index 69e1e2652c9..06180291e91 100644 --- a/src/plots/gl2d/scene2d.js +++ b/src/plots/gl2d/scene2d.js @@ -137,6 +137,11 @@ proto.makeFramework = function() { canvas.style.left = '0px'; canvas.style['pointer-events'] = 'none'; + // disabling user select on the canvas + // sanitizes double-clicks interactions + // ref: https://github.com/plotly/plotly.js/issues/744 + canvas.className += 'user-select-none'; + // create SVG container for hover text var svgContainer = this.svgContainer = document.createElementNS( 'http://www.w3.org/2000/svg',