Files
ComfyUI_frontend/cloud-loader-dropdown.md
2025-11-29 19:14:34 -07:00

1.1 KiB
Raw Permalink Blame History

Fixes loader dropdown placeholder

Cloud loader dropdowns hydrate via useAssetWidgetData(nodeType), so dropdownItems stays empty until the Asset API returns friendly filenames. Meanwhile modelValue already holds the saved asset and the watcher at WidgetSelectDropdown.vue#L215-L227 only tracks modelValue. It runs before assets load, fails to find a match, clears selectedSet, and the placeholder persists.

watch(
  modelValue,
  (currentValue) => {
    if (currentValue === undefined) {
      selectedSet.value.clear()
      return
    }
    const item = dropdownItems.value.find((item) => item.name === currentValue)
    if (item) {
      selectedSet.value.clear()
      selectedSet.value.add(item.id)
    }
  },
  { immediate: true }
)

Once the API resolves, dropdownItems recomputes but nothing resyncs because the watcher never sees that change. Desktop doesnt hit this because it still reads from widget.options.values immediately.