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

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

From: <bugzilla@jessica.w3.org>
Date: Wed, 09 Mar 2011 14:43:27 +0000
To: public-html@w3.org
Message-ID: <bug-12271-2495@http.www.w3.org/Bugs/Public/>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=12271

           Summary: <input list=""> needs an event triggered on selection
                    of suggestion
           Product: HTML WG
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: ben.bucksch@beonex.com
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


4.10.7.2 Common input element attributes
4.10.7.2.3 The list attribute
Current spec text: 
> When the user selects a suggestion, the input element's value must
> be set to the selected suggestion's value, as if the user had written
> that value himself.

While this implements an autocomplete widget, and allows labels, the action
should be configurable by the page, using an event handler, e.g. onListSelect.

Just specifying that the value must be set/added to the textfield, as you
currently do (quoted above), fails many important usecases:
1. Your own example of email address autocomplete, under section "The multiple
attribute". Here, you conveniently let only the email address be added to the
textfield, but that's neither user-friendly nor what current email clients like
Thunderbird do. Instead, they add "Arthur Dosh <art@example.net>" instead of
"art@example.net", but that would not work in your example with the labels.
2. While writing something akin to Firefox' awesomebar, I need something that
triggers different actions based on what's selected: We either load the
selected URL, or we start a search with the proposed search term (whereby the
search term is the value), or we start a search with a given search engine (we
have several search engines, and suggest providers, and the search needs to go
to the engine that provided the suggestion). This can only be done with custom
actions.

I'm sure there are tons of other cases where the action must be something else
other than just setting/adding the text to the textfield.

As said, this could be solved with simply adding an event that's fired when the
user selects an item from the list. The default handler could still be to
set/add the value as text to the textfield.

If the element does not have a multiple attribute specified or if the multiple
attribute does not apply

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Wednesday, 9 March 2011 14:43:28 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:23 UTC