W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2009

[whatwg] focus change inside keypress event handler

From: Thomas Broyer <t.broyer@gmail.com>
Date: Wed, 28 Oct 2009 10:01:46 +0100
Message-ID: <a9699fd20910280201h3c7990a1s7cb9a7e5dc2c60c1@mail.gmail.com>
On Wed, Oct 28, 2009 at 2:43 AM, Michael A. Puls II
<shadow2531 at gmail.com> wrote:
> (CCing DOM list just in case anyone there has any comments)
> With:
> <p><input onkeypress="this.nextSibling.focus()"><input></p>
> , if you type a character in the first field, should the character be
> entered in the second field or the first?
> In Firefox and Safari, it's the first field. In IE and Opera, it's the
> second.
> I do think FF and Safari's way makes more sense and I think most will agree.

If we consider keypress to be the same as DOM-3 Events' textinput,
then it makes way more sense for the char to be added to the first
field (i.e. the Gecko/WebKit way).

My .2c

Thomas Broyer
Received on Wednesday, 28 October 2009 02:01:46 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:18 UTC