Add datalist element normalization #153

Closed
yefremov opened this Issue Dec 27, 2012 · 1 comment

Comments

Projects
None yet
2 participants

Please add datalist element normalization as it states in WHATWG 4.10.10 The datalist element spec:

In the rendering, the datalist element represents nothing and it, along with its children, should be hidden.

Problem: IE 6/7/8/9 renders datalist and its option elements.

I have created fiddle http://jsfiddle.net/fyH7Y/, so you can test more browsers.

Owner

necolas commented Jan 19, 2013

That's the point of the datalist design (although I don't think the spec is all that clear about it from an author perspective).

You're meant to include just option elements with value attributes:

<datalist id="furniture">
    <option value="chair"></option>
    <option value="table"></option>
    <option value="bed"></option>
</datalist>

This won't show at all in legacy browsers. Or you do something more complicated to act as fallback content when the browser doesn't support datalist, e.g.:

http://jsfiddle.net/fyH7Y/2/

Hope that helps.

necolas closed this Jan 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment