[whatwg] focus change inside keypress event handler

Michael A. Puls II shadow2531 at gmail.com
Sat Oct 31 01:54:25 PDT 2009


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().

-- 
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20091031/68dcf7a9/attachment-0002.html>


More information about the whatwg mailing list