[Bug 9785] Add a "filter" attribute. If set, the user agent will filter the datalist. If not, filter won't be filtered automatically (unless you do some sort of filtering by javascript or/and server-side)

http://www.w3.org/Bugs/Public/show_bug.cgi?id=9785


Jonas Sicking <jonas@sicking.cc> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jonas@sicking.cc




--- Comment #1 from Jonas Sicking <jonas@sicking.cc>  2010-08-04 18:36:59 ---
We ran into this issue too when discussing the firefox implementation of
datalist.

Two usage scenarios we could see for <datalist> are:

1.
A static set of completions which the user will usually choose between. For
example:

<input list=managers>
<datalist id=managers>
  <option>Sven</option>
  <option>Agneta</option>
  <option>Björn</option>
  <option>Håkan</option>
  <option>Lisa</option>
  <option>Anne-Frid</option>
  <option>Benny</option>
</datalist>

2.
A dyanmically populated list based on more complex conditions. Consider for
example the google autosuggest feature.

<script>
function handleInput(value) {
  var xhr = new XMLHttpRequest();
  xhr.open("GET", "/suggestions.cgi?" + value);
  xhr.send();
  xhr.onload = function() {
    document.getElementById("suggestions").innerHTML = xhr.responseText;
  }
}
</script>
<input list=suggestions oninput="handleInput(this.value);">
<datalist id=suggestions></datalist>


In use case 1 it makes sense for the UA to only display results that contain
(or even starts with) the string that the user has typed so far. In use case 2
it makes sense to display *all* the results that the server cgi script thought
were relevant. For example if I type "200 sek" in google, the first result it
shows is "200 Swedish kronor = 27.9998 US dollars".


I suspect that letting the UA apply filtering is a reasonable default. However
it would be very good to be able to set a boolean attribute on either the
<input> or the <datalist> stating that filtering should not happen.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 4 August 2010 18:37:01 UTC