fixed a serious bug with form submission and

return/enter key handling
This commit is contained in:
2010-03-10 22:57:23 +02:00
parent 05a0ccfe06
commit d9e5bf3f22

View File

@@ -32,11 +32,24 @@
self.hide();
}).keydown(function(e){
switch(e.keyCode) {
case ARRUP: self.select_prev($e, $options); return false;
case ARRDN: self.select_next($e, $options); return false;
case ESC: self.clear($e, $options); break;
case RETURN: self.activate_selected($options); return false;
default: self.clearTimeout(); self.search($e, $options);
case ARRUP:
self.select_prev($e, $options);
return false;
case ARRDN:
self.select_next($e, $options);
return false;
case ESC:
self.clear($e, $options);
break;
case RETURN:
if (self.selected_result !== null) {
self.activate_selected($options);
return false;
}
break;
default:
self.clearTimeout();
self.search($e, $options);
}
}).keyup(function(e){
if (e.keyCode > SPECIALS_END || e.keyCode == BACKSPACE) {