diff --git a/src/scripts/domWidget.ts b/src/scripts/domWidget.ts index 146f214ba..a59306a7b 100644 --- a/src/scripts/domWidget.ts +++ b/src/scripts/domWidget.ts @@ -264,7 +264,7 @@ LGraphNode.prototype.addDOMWidget = function ( options = { hideOnZoom: true, selectOn: ['focus', 'click'], ...options } if (!element.parentElement) { - document.body.append(element) + app.canvasContainer.append(element) } element.hidden = true element.style.display = 'none' @@ -335,8 +335,8 @@ LGraphNode.prototype.addDOMWidget = function ( Object.assign(element.style, { transformOrigin: '0 0', transform: scale, - left: `${transform.a + transform.e + elRect.left}px`, - top: `${transform.d + transform.f + elRect.top}px`, + left: `${transform.a + transform.e}px`, + top: `${transform.d + transform.f}px`, width: `${widgetWidth - margin * 2}px`, height: `${(widget.computedHeight ?? 50) - margin * 2}px`, position: 'absolute',