adobe / adobe/spectrum-web-components
[Feat]:Support sp-combobox to take both itemText and value, so that duplicate itemTexts can exist in the list
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 262
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 68
Description
### Code of conduct
- [x] I agree to follow this project's code of conduct.
### Impacted component(s)
sp-combobox
### Description of the requested feature
When there is a list of items, which has itemText and value. Currently, the combobox only supports the itemText to be sent to change event. So any handling needs to be done using itemText.
But is the list of items has duplicate items with same itemText and different value (uniqueId, in our case its projectId). In this case, we would need both itemText and value to be sent to the change event. So the handling can be done based on both the itemText and value, even if the itemText is same, we can use value as differentiator.
So the request here is to, expose an explicit selectedValue property would eliminate reliance on itemText uniqueness and provide a more reliable contract for downstream consumers.
Reference thread: https://cclight.slack.com/archives/CESK60MQD/p1764083843191409
### Mockups or screenshots
_No response_
### Implementation notes or ideas
_No response_
### Would you like to track this issue in Jira?
- [x] Yes, please tell me the ticket number!
Contributor guide
Research direction
Locate the sp-combobox component and trace its current itemText handling and change-event contract. Determine where an explicit selectedValue property belongs, then verify the behavior for duplicate itemText values and distinct values with the component's existing tests or event usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100