Re: Option element in a Datalist with no label

On 3/14/12 10:24 PM, Sharon Newman (COHEN) wrote:
> With the following code:
> <input list=”test” type=text>
> <datalist id=test>
> <option value=”a”>
> <option value = “b”>
> <option value=”c”>
> </datalist>
>
> According to the spec, these options don’t have a label, however, in FF
> and Opera today the value is being displayed as the label.

"Displayed as the label" in which sense?

If you're looking at the actual behavior when typing in the input, the 
relevant spec section is 
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#attr-input-list 
which says:

   The user agent may use the suggestion's label to identify the
   suggestion if appropriate.

There's nothing past that in the spec that really talks about how the 
suggestions should be exposed to the user, as far as I can see. 
Specifically, nothing requires the UA to actually present to 
suggestions, and nothing requires the UA to use the suggestion labels to 
identify the suggestions.  Unless I'm missing something, of course.

-Boris

Received on Thursday, 15 March 2012 15:04:24 UTC