Open ilhan007 opened 8 months ago
There is not way to define a key, which is hidden and a value to display (translated) Selected option should always set the value of the key to the FormControl. See simple html select https://www.w3schools.com/tags/att_option_value.asp
"value" is the key "innerHtml" is the translatable value to display Issue 91 for example Most of the no FormControl issues are related to "touched" not updated. -> We only set Error state to inputs AFTER they are touched to prevent the whole form being red without touching anything. So we need to call markAsTouched on the FormControl after a change manually
Select web component already has this key-value props available - the Option has "value" (which is like key, it's not displayed) and text content (which is the displayed "value" in key-value terms).
It's true the ComBoxItem and the MultiComboBoxItem don't provide a pair of props, they both have "text" (which is the displayed "value" in key-value terms), but don't have "key" or equivalent.
The main use-case that the author provided is a list of countries and their codes and the codes he would like to set as keys that are not displayed, but later get. Alternative that could be done is to maintain this mapping in the app code, which he finds somewhat inconvenient.
@timogeib feel free to add more to that
Hello @SAP/ui5-webcomponents-topic-rl this feature request belongs to your ownership.
Internal BLI was created: BGSOFUIRILA-3771
Feature Request Description
Select web component already has this key-value props available - the Option has "value" (which is like key, it's not displayed) and text content (which is the displayed "value" in key-value terms).
The ComBoxItem and the MultiComboBoxItem don't provide a pair of props, they both have "text" (which is the displayed "value" in key-value terms), but don't have "key" or equivalent.
The main use-case that the author provided is a list of countries and their codes and the codes he would like to set as keys that are not displayed, but later get. Alternative that could be done is to maintain this mapping in the app code, which he finds somewhat inconvenient.
Proposed Solution
Add support for "key", "value" ("text" already plays as "value", so "key" is the missing piece).
Proposed Alternatives
Alternative that could be done is to maintain this mapping in the app code, which he finds somewhat inconvenient.
Organization
SAP Build Process Automation
Additional Context
No response
Priority
None
Privacy Policy