mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-23 22:22:11 -03:00
feat(autocomplete): support input element sharing for subgraph promotion
Store textarea reference on container element to allow cloned widgets to access inputEl when promoted to subgraph nodes. This ensures both original and cloned widgets can properly get and set values through the shared DOM element.
This commit is contained in:
@@ -117,6 +117,16 @@ onMounted(() => {
|
||||
// Register textarea reference with widget
|
||||
if (textareaRef.value) {
|
||||
props.widget.inputEl = textareaRef.value
|
||||
|
||||
// Also store on the container element for cloned widgets (subgraph promotion)
|
||||
// When widgets are promoted to subgraph nodes, the cloned widget shares the same
|
||||
// DOM element but has its own inputEl property. We store the reference on the
|
||||
// container so both original and cloned widgets can access it.
|
||||
const container = textareaRef.value.closest('[id^="autocomplete-text-widget-"]') as HTMLElement
|
||||
if (container && (container as any).__widgetInputEl) {
|
||||
(container as any).__widgetInputEl.inputEl = textareaRef.value
|
||||
}
|
||||
|
||||
// Initialize hasText state
|
||||
hasText.value = textareaRef.value.value.length > 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user