Skip to content

Commit

Permalink
gl2d: add user-select-none class to canvas
Browse files Browse the repository at this point in the history
- this sanitizes double clicks interactions
- e.g. double-click on the canvas now no longer puts
  the select-box in a weird state
- see #744 for more info
  • Loading branch information
etpinard committed Sep 21, 2016
1 parent de6a183 commit 1522b68
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plots/gl2d/scene2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 1522b68

Please sign in to comment.