Skip to content

Commit 4b04131

Browse files
committed
Only blank string unsets legend items
1 parent 4943e3a commit 4b04131

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/components/legend/draw.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ var anchorUtils = require('./anchor_utils');
3131

3232
var SHOWISOLATETIP = true;
3333
var DBLCLICKDELAY = interactConstants.DBLCLICKDELAY;
34-
var BLANK_STRING_REGEX = /^[\s\r]*$/;
3534

3635
module.exports = function draw(gd) {
3736
var fullLayout = gd._fullLayout;
@@ -416,7 +415,7 @@ function drawTexts(g, gd) {
416415

417416
var carr = Lib.keyedContainer(fullInput, 'transforms[' + index + '].styles', 'target', 'value.name');
418417

419-
if(BLANK_STRING_REGEX.test(origText)) {
418+
if(origText === '') {
420419
carr.remove(legendItem.trace._group);
421420
} else {
422421
carr.set(legendItem.trace._group, text);

0 commit comments

Comments
 (0)