diff --git a/src/scripts/domWidget.ts b/src/scripts/domWidget.ts index 7086f4201..09ae7ff45 100644 --- a/src/scripts/domWidget.ts +++ b/src/scripts/domWidget.ts @@ -360,7 +360,7 @@ LGraphNode.prototype.addDOMWidget = function < const onRemoved = this.onRemoved this.onRemoved = function (this: LGraphNode) { - element.remove() + widget.onRemove() elementWidgets.delete(this) onRemoved?.call(this) }