[whatwg] input element list attribute and filtering suggestions

On Mon, May 2, 2011 at 3:32 PM, Ian Hickson <ian at hixie.ch> wrote:
> On Fri, 31 Dec 2010, Jonas Sicking wrote:
>> >
>> > The thing that makes this different than "Google suggest"-style UI is
>> > that in the latter case you need a script that continually polls for
>> > more appropriate suggestions and updates the list -- for this kind of
>> > thing we'd probably want to use a direct API, we wouldn't want to have
>> > scripts have to poke at the <datalist> DOM in real time.
>>
>> Why not?
>>
>> The firefox implementation should allow this (though I haven't tried
>> this myself). Feel free to try it out and let us know how well/poorly it
>> works.
>
> I just meant that it would be a poor authoring experience. I agree that it
> should in theory be possible with the current API; it just seems that if
> that's the use case we want to address, we should instead just have
> people point to a URL and be done with it:
>
> ? <input type=text autosuggest="/cgi-bin/autocomplete.pl">
>
> ...or some such.

Sure, but that seems like a significantly more complex solution to
design. We'd likely have to add features like deciding how many
milliseconds to wait for another keystroke before sending the request.
We'd also have to come up with a file-format for the response, and a
definition of how the typed value is supposed to be sent with the
request.

I'd also be worried about making it possible to write keyloggers on
sites that filter out scripts, but do allow form controls to be
inserted.

It seems to me that a simple boolean attribute and a few lines of
script solves 80% of the use cases.

/ Jonas

Received on Monday, 2 May 2011 17:22:59 UTC