Re: [whatwg] focus change inside keypress event handler

On Fri, 30 Oct 2009 18:56:33 -0400, Boris Zbarsky <bzbarsky@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

Received on Saturday, 31 October 2009 08:54:57 UTC