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

[whatwg] focus change inside keypress event handler

From: Michael A. Puls II <shadow2531@gmail.com>
Date: Sat, 31 Oct 2009 04:54:25 -0400
Message-ID: <op.u2nponmr1ejg13@sandra-svwliu01>
On Fri, 30 Oct 2009 18:56:33 -0400, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> On 10/30/09 6:41 PM, Michael A. Puls II wrote:
>>>> Is there a good way to solve that though? Or is that something that
>>>> should just be left as YMMV?
>>> Well, you could require an alert to block all key event delivery to
>>> the web page, right?
>> Would that be a desirable solution? Is that hard to implement?
> I don't know, and I don't know.  The answer to the latter question  
> depends strongly on the precise event model the browser is using, how it  
> interacts with the OS, what it actually does for alert, etc.

Another thing I noticed:

With the attached, 'keyup' doesn't fire if you use an alert() in the  
'keydown' or 'keypress' handler.

Well, actually, it fires sometimes in Firefox and Safari, but it's not  
very consistent. Avoiding alert()s makes things more consistent.

I also noticed that with the attached in Opera, if you press the spacebar  
in the field, the alert that pops up disappears right away because the  
space somehow gets invoked on the OK button on the alert().

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20091031/68dcf7a9/attachment.html>
Received on Saturday, 31 October 2009 01:54:25 UTC

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