Skip to content

[6.x] Fix dictionary single-select showing the raw id instead of the label#14935

Open
mynetx wants to merge 1 commit into
statamic:6.xfrom
mynetx:fix/dictionary-single-select-label
Open

[6.x] Fix dictionary single-select showing the raw id instead of the label#14935
mynetx wants to merge 1 commit into
statamic:6.xfrom
mynetx:fix/dictionary-single-select-label

Conversation

@mynetx

@mynetx mynetx commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

When a dictionary's options() doesn't return the whole dataset (e.g. an API-backed dictionary), a single-select dictionary field shows the stored id instead of its label until you re-select it. The Combobox resolves labels from the options it's given, and the stored value may not be in them — the preloaded selected options (which carry the labels) were only used by multi-select's badges.

This merges the selected options into the options passed to the Combobox in single mode, so the label always resolves. Multi-select is left as-is since it didn't have the problem.

Fixes #14835

The Combobox resolves selected labels from the options it's given, but an
API-backed dictionary's options endpoint may not include the stored value, so a
single-select field rendered the raw id until re-selected. Merge the preloaded
selected options into the options passed to the Combobox so their labels always
resolve. Multi-select wasn't affected since it renders its badges from the
preloaded data directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dictionary fieldtype: single-select shows the raw id instead of the label

1 participant