mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-06 08:00:05 +00:00
Fix widgets added after previews on subgraph nodes (#5084)
Image previews are displayed on nodes as a widget. If a new input is added to a subgraph that already has an image preview, that widget is incorrectly placed after the preview. This is fixed by instead counting the number of existing inputs that are already linked to widgets.
This commit is contained in:
@@ -361,7 +361,8 @@ export class SubgraphNode extends LGraphNode implements BaseLGraph {
|
||||
}
|
||||
})
|
||||
|
||||
this.widgets.push(promotedWidget)
|
||||
const widgetCount = this.inputs.filter((i) => i.widget).length
|
||||
this.widgets.splice(widgetCount, 0, promotedWidget)
|
||||
|
||||
// Dispatch widget-promoted event
|
||||
this.subgraph.events.dispatch('widget-promoted', {
|
||||
|
||||
Reference in New Issue
Block a user