Tuesday, 13 August 2013

In IE9 dblclick on input box firing keydown and keyup event

In IE9 dblclick on input box firing keydown and keyup event

I have a text field which is validated before submitting and certain
handling of enter and escape buttons. code goes as follows
i.onkeyup = function(e) {
var k = IEBROWSER ? event.keyCode : e.keyCode;
console.log(" onkeyup "+event.keyCode+" "+e.keyCode);
switch(k) {
case 13:
this.onchange();
break;
case 27:
textInvalid=false;
this.cancelEdit();
break;
case 37: case 38: case 39: case 40:
break;
default:
this.validate();
}
}
This code works fine in all the browsers including IE7 but in IE9 and
IE10, if i double click on the text field onKeyUp and onKeyDown events are
fired with the following logs
onkeyup 67 67
onkeyup 17 17
Does anyone has any idea why it is fired? and why the key code 67 and 17
with single double click?

No comments:

Post a Comment