From 00dbdad8f832535bc850d712bfbb6a051166a75d Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Tue, 27 Sep 2022 13:24:42 +0200 Subject: [PATCH] Minor bugfix --- src/svg/SVGEdge.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/svg/SVGEdge.js b/src/svg/SVGEdge.js index b73652e..a036bf6 100644 --- a/src/svg/SVGEdge.js +++ b/src/svg/SVGEdge.js @@ -63,10 +63,10 @@ export default class SVGEdge extends EventEmitter { // Note that firstTag will be null if this as newly-dragged connection! const firstTag = this.edge.bodies - .find(b => b.purpose === 'tagging') || { value: 'foo' }; + .find(b => b.purpose === 'tagging')?.value; if (label && firstTag) { - const text = label.find('text').text(firstTag.value); + const text = label.find('text').text(firstTag); const { width, height } = text[0][0].node.getBBox(); label.find('rect') @@ -78,6 +78,8 @@ export default class SVGEdge extends EventEmitter { .attr('height', Math.round(height) + 4); label.attr('style', null); + } else { + label.attr('style', 'display: none'); } }