[whatwg] Two propositions for the autofocus attribute
kit at iqmultimedia.com.au
Thu Apr 15 17:44:37 PDT 2010
On 16/04/2010, at 9:08 AM, Jonas Sicking wrote:
> While we could deploy a bunch of heuristics, it seems much simpler to
> just say that it is the *first* element with autofocus that should
> receive focus. I can't think of any significant downsides with this.
For instance, picture the Gmail model. When you first load, the autofocus attribute could conceivably be on the inbox search field. When you click Compose, the compose form will be dynamically added and the "To" field should be autofocused (but the search field is still on-screen)
I suppose you could argue that it'd be up to the application to go and *remove* the previous autofocus attribute from the search field, or should manage focus as they currently do with HTMLInputElement.focus(), but I can see the simplicity that automatically moving the focus would represent for these sorts of applications.
More information about the whatwg