mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-08 09:00:05 +00:00
Attach DOM widgets to canvas container instead of document body (#364)
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user