Comfy-Org / Comfy-Org/ComfyUI_frontend

control_after_generate is a silent no-op on numeric combo widgets

Closed Beginner friendly
#14,539 2 comments 1 reaction 0 assignees View on GitHub
Potential Bug
Dominant language
TypeScript
Stars
2k
Forks
702
Avg merge
1d 8h
Merged PRs (30d)
512

Description

Found by @christian-byrne while reviewing #14460, split out because it is pre-existing and out of that PR's scope. Verified independently at HEAD.

## What happens

`control_after_generate` does nothing on a combo widget whose options are numbers, and logs nothing to explain why.

## Mechanism

`src/scripts/valueControl.ts:93-109`:

```ts
const allValues = rawValues.filter(
(value): value is string => typeof value === 'string'
)
const check = buildComboFilter(comboFilter, nodeId)
const values = check ? allValues.filter(check) : allValues

if (!values.length) {
if (allValues.length) {
console.warn(
'Filter for node ' + String(nodeId) + ' has filtered out all items',
comboFilter
)
}
return undefined
}
```

Options are filtered to `typeof value === 'string'`, so an all-numeric option list yields an empty `allValues`, and therefore an empty `values`. The function returns `undefined` at `:109`, before `target.value` is read at `:111`.

The diagnostic is unreachable for exactly this case: the "filtered out all items" warning is gated on `allValues.length`, which is the array that was **already** emptied by the type filter. So nothing is logged, and the feature silently does nothing.

## Impact

Any numeric combo with `control_after_generate` — the input spec supports it via `zComboInputOptions.control_after_generate` — appears to have a working control widget that never changes the value.

## Pre-existing

`git blame` at the merge base `2c937310a3` attributes these lines to `0157b470241` (Alexander Brown, 2026-05-27). Not introduced or worsened by #14460.

## Related

Same bug family as #14460 and #14538: option lists that are numbers being treated as if they were strings.

Contributor guide

Open the contributing guide

Research direction

Start in src/scripts/valueControl.ts:93-111 and reproduce a combo widget using numeric options with control_after_generate. Trace the type filtering and early return, then verify the completed behavior by confirming numeric options are handled instead of the control silently doing nothing.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.