adobe/spectrum-web-components

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

Offen

#4.283 geöffnet am 18.04.2024

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (256 Forks)auto 404
Component:ComboboxFeatureGood first issueSEV missing

Repository-Metriken

Stars
 (1.525 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Code of conduct

  • I agree to follow this project's code of conduct.

Impacted component(s)

Combobox

Expected behavior

Let's say I have the following markup:

<sp-combobox size="m" label="Color">
    <sp-menu-item value="red">Red</sp-menu-item>
    <sp-menu-item value="green">Green</sp-menu-item>
    <sp-menu-item value="blue">Blue</sp-menu-item>
</sp-combobox>

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