Skip to content

Commit

Permalink
Minor bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimon committed Sep 27, 2022
1 parent e821da4 commit 00dbdad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/svg/SVGEdge.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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');
}
}

Expand Down

0 comments on commit 00dbdad

Please sign in to comment.