[6.x] Fix dictionary single-select showing the raw id instead of the label#14935
Open
mynetx wants to merge 1 commit into
Open
[6.x] Fix dictionary single-select showing the raw id instead of the label#14935mynetx wants to merge 1 commit into
mynetx wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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