[whatwg] input element list attribute and filtering suggestions

Mounir Lamouri mounir.lamouri at gmail.com
Thu Sep 23 14:37:18 PDT 2010


The list attribute [1] on input elements let the author specify a list
of pre-defined suggestions via the datalist element (each option of the
datalist is a suggestion). It looks like the idea is to have all the
suggestions showing like a combobox which is more or less confirmed by
Hixie [2].

However, it sounds like having a static combobox would only fulfill some
use cases (ie. when a very small set of suggestions is defined). In most
obvious situations, having a list with all the suggestions would be
annoying. So, it might be interesting to have the list filtered with the
current element's value to be able to use the list attribute for large
list and have a boolean attribute to enable or disable the filtering.
One simple use case would be a city transportation website. If you have
to type a station name in a field it might be much more user friendly to
have a filtered list.

Actually, I do not see any use case of the list attribute without
filtering. To me, it seems like a replacement of a select with options
and an input fields in the case of "none of the above". And I do not
think this replacement would be better.
I am wondering what were the use cases in mind?

So, the current implementation of the list attribute in Gecko [3] is
filtering the list with the element's value by default [4] and we have
introduced a mozNoFilter boolean attribute which can be used to have a
non-filtered list.

Feedbacks are welcome :)

[2] http://www.w3.org/Bugs/Public/show_bug.cgi?id=9785
[3] Available in current Firefox nightlies and will be in beta7.
[4] To be exact, the filter is done on the option's label


More information about the whatwg mailing list