[backport core/1.40] fix: textarea stays disabled after link disconnect on promoted widgets (#9199) (#9577)

Backport of #9199 to core/1.40.

Conflicts resolved in useGraphNodeManager.ts/test.ts — accepted incoming
promoted widget handling changes.

**Original PR:** https://github.com/Comfy-Org/ComfyUI_frontend/pull/9199
**Pipeline ticket:** 15e1f241-efaa-4fe5-88ca-4ccc7bfb3345

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9577-backport-core-1-40-fix-textarea-stays-disabled-after-link-disconnect-on-promoted-widge-31d6d73d365081619c7cfbea1bbc4463)
by [Unito](https://www.unito.io)
This commit is contained in:
Christian Byrne
2026-03-07 18:30:56 -08:00
committed by GitHub
parent 22eefc4222
commit 602784a672
2 changed files with 204 additions and 4 deletions

View File

@@ -68,6 +68,12 @@ export interface SafeWidgetData {
spec?: InputSpec
/** Input slot metadata (index and link status) */
slotMetadata?: WidgetSlotMetadata
/**
* Original LiteGraph widget name used for slot metadata matching.
* For promoted widgets, `name` is `sourceWidgetName` (interior widget name)
* which differs from the subgraph node's input slot widget name.
*/
slotName?: string
}
export interface VueNodeData {
@@ -226,9 +232,12 @@ function safeWidgetMapper(
...sharedEnhancements,
callback,
hasLayoutSize: typeof widget.computeLayoutSize === 'function',
isDOMWidget: isDOMWidget(widget),
options,
slotMetadata: slotInfo
isDOMWidget: isDOMWidget(widget) || isPromotedDOMWidget(widget),
options: isPromotedPseudoWidget
? { ...options, canvasOnly: true }
: options,
slotMetadata: slotInfo,
slotName: name !== widget.name ? widget.name : undefined
}
} catch (error) {
return {
@@ -341,7 +350,7 @@ export function useGraphNodeManager(graph: LGraph): GraphNodeManager {
// Update only widgets with new slot metadata, keeping other widget data intact
for (const widget of currentData.widgets ?? []) {
const slotInfo = slotMetadata.get(widget.name)
const slotInfo = slotMetadata.get(widget.slotName ?? widget.name)
if (slotInfo) widget.slotMetadata = slotInfo
}
}