<datalist>
displaying both label and values for option
elements is a little confusing
#10594
Labels
<datalist>
displaying both label and values for option
elements is a little confusing
#10594
What is the issue with the HTML Standard?
When using a
datalist
it is not obvious reading the spec that both the label and value will be shown, and even then thatvalue
takes precedence when displayed. When I use anoption
in aselect
element I don't see the value I only see the label, but when used in adatalist
the value is always present and takes a high emphasis over the label.I know that the spec is clear that the
datalist
is distinct from aselect
element however it does not mention anything about this and as they both useoption
elements I would have expected the behaviour to be closer to each other.I've used this before and it's always found this behaviour slightly confusing and it's caused a few problems. As I didn't want to show the value just the label (like a select) but wanted the input & datalist to function as a select-like element that you can type in. As such I just had to just display the label text and then match that to the matching value with JS once it had been selected, rather than just rely on the value.
The text was updated successfully, but these errors were encountered: