You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Showing 0 instead of empty string in OptionsList #894
In #894, an application migrating to Ant Design uses an empty option label for a reset entry, but the dropdown displays its value, 0.
For options={[{ value: 0, label: '' }]}, the current default renderer falls back to the value. The selected single-value renderer preserves the empty label.
This is longstanding behavior, not a new regression. #1254 explicitly preserved blank-string handling. The documented optionRender callback can bypass the default content fallback; this workaround has been checked in source, not run locally.
If maintainers prefer a different default, the change would preserve literal-empty-string option labels without adding an API. It would leave the shared renderability helper and existing handling of null, undefined, false, numeric 0, whitespace labels, and custom renderers unchanged.
Validation would use pure fallback-decision tests and browser checks for dropdown content, derived titles, selected labels, and keyboard selection, including blank and numeric-zero labels. No implementation has been prepared.
Should an explicit empty-string option label remain blank by default, or should this use case continue to require optionRender?
Activity
clean99 commentedon Dec 3, 2026
In #894, an application migrating to Ant Design uses an empty option label for a reset entry, but the dropdown displays its value,
0.For
options={[{ value: 0, label: '' }]}, the current default renderer falls back to the value. The selected single-value renderer preserves the empty label.This is longstanding behavior, not a new regression. #1254 explicitly preserved blank-string handling. The documented
optionRendercallback can bypass the default content fallback; this workaround has been checked in source, not run locally.If maintainers prefer a different default, the change would preserve literal-empty-string option labels without adding an API. It would leave the shared renderability helper and existing handling of
null,undefined,false, numeric0, whitespace labels, and custom renderers unchanged.Validation would use pure fallback-decision tests and browser checks for dropdown content, derived titles, selected labels, and keyboard selection, including blank and numeric-zero labels. No implementation has been prepared.
Should an explicit empty-string option label remain blank by default, or should this use case continue to require
optionRender?