W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > April 2010

[Bug 9547] New: If more than one element has the autofocus attribute specified, only the first one should be focused

From: <bugzilla@jessica.w3.org>
Date: Sat, 17 Apr 2010 15:35:00 +0000
To: public-html-bugzilla@w3.org
Message-ID: <bug-9547-2486@http.www.w3.org/Bugs/Public/>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=9547

           Summary: If more than one element has the autofocus attribute
                    specified, only the first one should be focused
           Product: HTML WG
           Version: unspecified
          Platform: All
               URL: http://dev.w3.org/html5/spec/forms.html#attr-fe-autofo
                    cus
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTML5 spec proposals
        AssignedTo: dave.null@w3.org
        ReportedBy: mounir.lamouri@gmail.com
         QAContact: public-html-bugzilla@w3.org
                CC: ian@hixie.ch, mike@w3.org, public-html@w3.org,
                    jonas@sicking.cc


At the moment, the autofocus attribute specification say only one element in
the document should have the autofocus attribute specified but each time an
element with the autofocus attribute is inserted into the document, it should
be focused following the given rules. In other words, only one element should
have the autofocus attribute specified and the last one will have the autofocus
applying if there are more than one.

It would be probably better to have the exact opposite behavior: only the first
element with the autofocus attribute specified should have the autofocus
behavior applying. For the author, having more than one element with the
autofocus attribute is already wrong and for the user it would be better.
For example:
<html>
  <body>
    <form>
      <input id=c1 autofocus>
    </form>
    ...lots of content here...
    <form>
      <input id=c2 autofocus>
    </form>
  </body>
</html>
The user will have the focus on the first input element and then the second
input element will be focused. This may be really annoying. The specifications
already said the autofocus may be ignored if the user has began to interact
with the document. This can be done by not autofocusing when an element is
already focused but it's would be a violation of the current specifications.

The change could be made in two ways:
- only the first focusable element with autofocus specified should be focused,
or
- the autofocus attribute apply only if there is no focused element in the
document.

-- 
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 Saturday, 17 April 2010 15:35:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 17 April 2010 15:35:09 GMT