Re: DOM3 Key events

On 1/08/2007, at 4:36 PM, Boris Zbarsky wrote:

> Oliver Hunt wrote:
>> Really?  By my testing it matches Firefox 2 behaviour on both mac  
>> and windows.
>> IE behaviour results in the keypress not being fired.
>
> Oh, I see.  Firefox behavior is to fire the keypress event but to  
> call preventDefault() on it first, so that the default action  
> doesn't take place... Which has the same effect as what IE does in  
> the common case, but isn't exactly identical.

Exactly, and there are already sites that depend on that behaviour :-/

I couldn't find a site that was broken by the behaviour, and on  
balance it seems safe because it would seem unlikely that a site  
would depend on not getting the keypress event after preventDefault  
on a keydown -- it seems more likely that they just don't want actual  
input.

Oh, and it is not possible to prevent an input method from handling  
an event -- the windows IME system makes it hard to do, and IE  
doesn't allow it.  Also allowing an IM to be blocked seems like the  
kind of "feature" that will lead to more sites be accidentally broken  
for users of IMs.  *sigh*

>
> -Boris

--Oliver

Received on Thursday, 2 August 2007 00:50:46 UTC