You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The Combobox is less a fancy <select> (as seen with Picker) than a fancy <input> (as seen with Textfield) and should maintain a value that is the same as what is visible at all times. This can be particularly important when accepting values that are not represented by Menu Items provided to the Combobox, due to open user input. The conversion from value to key, as available, is pretty straight forward and we would definitely be open to a contribution of a property along the lines of valueKey (or an even classier name) to surface in parallel a matched item key when present.
najikahalsema
changed the title
[Bug]: sp-combobox value is not equivalent to the currently selected menu item
[Feature]: sp-combobox value is not equivalent to the currently selected menu item
May 22, 2024
Code of conduct
Impacted component(s)
Combobox
Expected behavior
Let's say I have the following markup:
I would expect that when I select the "Red" menu item in the combobox that the
value
of the comboxbox changes tored
which is the value of the selected menu item.Actual behavior
The
sp-comboxbox
value isRed
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?
value
of the comboboxvalue
asRed
Sample code that illustrates the problem
No response
Logs taken while reproducing problem
No response
The text was updated successfully, but these errors were encountered: