W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > March 2011

[Bug 12271] <input list=""> needs an event triggered on selection of suggestion

From: <bugzilla@jessica.w3.org>
Date: Tue, 22 Mar 2011 12:44:17 +0000
To: public-html-bugzilla@w3.org
Message-Id: <E1Q20wb-0001R2-Oc@jessica.w3.org>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=12271

--- Comment #2 from Ben Bucksch <ben.bucksch@beonex.com> 2011-03-22 12:44:17 UTC ---
> One thing that would make a lot of sense to me would be to fire the "change"
> event when the user selects something from the @list dropdown. Even if focus
> isn't moved to elsewhere. The "change" event is usually fired when there is
> some sense of finality in what the user has entered, rather than simply being
> in the middle of actively editing the value.

First off, maybe there's a misunderstanding. When I say "selection" /
"onListSelect", I mean that the user explicitly clicked on an entry with the
mouse, or he pressed Enter, Return or Space with the keyboard. I do *not* mean
that another list entry is highlighted after a mere mouse hover or keyboard
cursor keys.

> like an webmail app, you really do want the
> submitted value to be "Arthur Dosh <art@example.net>". For now the HTML5 spec
> doesn't satisfy that usecase very well I agree.

Exactly.
(And I just took that example, because the spec used that, but there are even
clearer ones.)

> But I'm not sure how adding an onListSelect helps here?

If label = "Arthur Dosh", value = "art@example.net", the dropdown display would
be fine (in this case). Opon selection, my code takes label + " <" + value +
">" and fills that into the textfield, possibly appending ", ", too.

More generally, the value that I fill in may not have anything to do with what
I show to the user in the dropdown and what I autocomplete to.

Another usecase: for database frontends, I may want to show only the name of
the person, but fill in the database ID. The user should never see the database
ID, but the ID is what my app actually uses. The user should be able to type to
autocomplete to the name. (I am not sure the input list or any other HTML5
widget covers this usecase well, but this proposal here would be a start.)

[awesomebar]
> If you for example press a key-combo which moves focus to elsewhere we
> don't navigate.

Maybe that's a misunderstanding, but I just meant that pressing keyboard
Enter/Return/Space, as well as mouse clicks, should trigger onListSelect, and I
start my action, e.g. loading the URL, starting a search (with various search
engines), switching the tab etc., depending on which entry the user selected.

The last thing - action changes depending on which entry the user selected (and
the entry's properties) - is not possible currently and critically important.

-- 
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 Tuesday, 22 March 2011 12:44:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 March 2011 12:44:26 GMT