Skip to content

Commit bc7a4c7

Browse files
committed
Fix removing part after tooltip changes
1 parent b45c9cf commit bc7a4c7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

simulator.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,7 @@ class Part {
11331133
this.subparts = {};
11341134
this.pins = {};
11351135
this.parent = parent;
1136+
this.tooltipPin = null;
11361137
}
11371138

11381139
// Load the given part and return it (because constructor() can't be async).
@@ -1298,9 +1299,11 @@ class Part {
12981299
// Show a tooltip when hovering over the pin.
12991300
let pinTitle = el.dataset.title || pin.name;
13001301
let removeTooltip = () => {
1302+
this.tooltipPin = null;
13011303
unhighlightConnection(pin.connected);
13021304
}
13031305
el.addEventListener('mouseenter', e => {
1306+
this.tooltipPin = pin;
13041307
highlightConnection(pin.connected);
13051308
this.schematic.simulator.tooltip.create(pin, pinTitle, removeTooltip, () => {
13061309
let dotRect = pin.dot.getBoundingClientRect();
@@ -1485,8 +1488,8 @@ class Part {
14851488
this.container.remove();
14861489

14871490
// Remove a pin tooltip, if it is present.
1488-
if (this.removeTooltip !== null) {
1489-
this.removeTooltip();
1491+
if (this.tooltipPin) {
1492+
this.schematic.simulator.tooltip.remove(this.tooltipPin);
14901493
}
14911494

14921495
return message;

0 commit comments

Comments
 (0)