Skip to content

Commit 040465e

Browse files
committed
drop user-select-none classes before adding to the top element
1 parent 346319c commit 040465e

File tree

6 files changed

+14
-27
lines changed

6 files changed

+14
-27
lines changed

src/components/legend/draw.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ module.exports = function draw(gd, opts) {
8989
if(title.text) {
9090
var titleEl = Lib.ensureSingle(scrollBox, 'text', 'legendtitletext');
9191
titleEl.attr('text-anchor', 'start')
92-
.classed('user-select-none', true)
9392
.call(Drawing.font, title.font)
9493
.text(title.text);
9594

@@ -410,7 +409,6 @@ function drawTexts(g, gd, opts) {
410409
var textEl = Lib.ensureSingle(g, 'text', 'legendtext');
411410

412411
textEl.attr('text-anchor', 'start')
413-
.classed('user-select-none', true)
414412
.call(Drawing.font, opts.font)
415413
.text(isEditable ? ensureLength(name, maxNameLength) : name);
416414

src/components/rangeselector/draw.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ function drawButtonText(button, selectorLayout, d, gd) {
144144
}
145145

146146
var text = Lib.ensureSingle(button, 'text', 'selector-text', function(s) {
147-
s.classed('user-select-none', true)
148-
.attr('text-anchor', 'middle');
147+
s.attr('text-anchor', 'middle');
149148
});
150149

151150
text.call(Drawing.font, selectorLayout.font)

src/components/sliders/draw.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,10 @@ function drawCurrentValue(sliderGroup, sliderOpts, valueOverride) {
302302
}
303303

304304
var text = Lib.ensureSingle(sliderGroup, 'text', constants.labelClass, function(s) {
305-
s.classed('user-select-none', true)
306-
.attr({
307-
'text-anchor': textAnchor,
308-
'data-notex': 1
309-
});
305+
s.attr({
306+
'text-anchor': textAnchor,
307+
'data-notex': 1
308+
});
310309
});
311310

312311
var str = sliderOpts.currentvalue.prefix ? sliderOpts.currentvalue.prefix : '';
@@ -357,11 +356,10 @@ function drawGrip(sliderGroup, gd, sliderOpts) {
357356

358357
function drawLabel(item, data, sliderOpts) {
359358
var text = Lib.ensureSingle(item, 'text', constants.labelClass, function(s) {
360-
s.classed('user-select-none', true)
361-
.attr({
362-
'text-anchor': 'middle',
363-
'data-notex': 1
364-
});
359+
s.attr({
360+
'text-anchor': 'middle',
361+
'data-notex': 1
362+
});
365363
});
366364

367365
var tx = data.step.label;

src/components/updatemenus/draw.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ function drawHeader(gd, gHeader, gButton, scrollBox, menuOpts) {
195195

196196
// draw drop arrow at the right edge
197197
var arrow = Lib.ensureSingle(gHeader, 'text', constants.headerArrowClassName, function(s) {
198-
s.classed('user-select-none', true)
199-
.attr('text-anchor', 'end')
198+
s.attr('text-anchor', 'end')
200199
.call(Drawing.font, menuOpts.font)
201200
.text(constants.arrowSymbol[menuOpts.direction]);
202201
});
@@ -435,11 +434,10 @@ function drawItemRect(item, menuOpts) {
435434

436435
function drawItemText(item, menuOpts, itemOpts, gd) {
437436
var text = Lib.ensureSingle(item, 'text', constants.itemTextClassName, function(s) {
438-
s.classed('user-select-none', true)
439-
.attr({
440-
'text-anchor': 'start',
441-
'data-notex': 1
442-
});
437+
s.attr({
438+
'text-anchor': 'start',
439+
'data-notex': 1
440+
});
443441
});
444442

445443
var tx = itemOpts.label;

src/plots/gl2d/scene2d.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,6 @@ proto.makeFramework = function() {
145145

146146
this.updateSize(canvas);
147147

148-
// disabling user select on the canvas
149-
// sanitizes double-clicks interactions
150-
// ref: https://github.com/plotly/plotly.js/issues/744
151-
canvas.className += ' user-select-none';
152-
153148
// create SVG container for hover text
154149
var svgContainer = this.svgContainer = document.createElementNS(
155150
'http://www.w3.org/2000/svg',

src/traces/carpet/plot.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ function drawAxisTitle(gd, layer, trace, t, xy, dxy, axis, xa, ya, labelOrientat
239239
'rotate(' + orientation.angle + ') ' +
240240
'translate(0,' + offset + ')'
241241
)
242-
.classed('user-select-none', true)
243242
.attr('text-anchor', 'middle')
244243
.call(Drawing.font, axis.title.font);
245244
});

0 commit comments

Comments
 (0)