adobe / adobe/spectrum-web-components

[Feature]: sp-combobox value is not equivalent to the currently selected menu item

Open
#4,283 2 comments 0 reactions 0 assignees View on GitHub
Component:Combobox Feature Good first issue SEV missing
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)

Combobox

### Expected behavior

Let's say I have the following markup:
```html

Red
Green
Blue

```
I would expect that when I select the "Red" menu item in the combobox that the `value` of the comboxbox changes to `red` which is the value of the selected menu item.

### Actual behavior

The `sp-comboxbox` value is `Red` which is the label of the menu item. Not the value.

### Screenshots

_No response_

### What browsers are you seeing the problem in?

Chrome

### How can we reproduce this issue?

1. Go to https://opensource.adobe.com/spectrum-web-components/components/combobox/#sizes
2. Open the comboxbox, click "Red"
3. Inspect the comboxbox element in the console
4. Check the `value` of the combobox
5. Observe that `value` as `Red`

### Sample code that illustrates the problem

_No response_

### Logs taken while reproducing problem

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the Combobox component and reproduce the issue using the markup and steps in the report, especially the Red menu item with value="red". Trace how the selected menu item's label and value are exposed, then verify that selecting Red makes the combobox value "red" rather than "Red".

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.