]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Ignore command (left and right/menu/windows), insert, caps lock, home...
authorScott González <scott.gonzalez@gmail.com>
Fri, 23 Apr 2010 17:00:54 +0000 (13:00 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 23 Apr 2010 17:00:54 +0000 (13:00 -0400)
Fixes #5415 - Catch all common keys while typing a word.

ui/jquery.ui.autocomplete.js

index 070045d16abb6a6e5df8ff9ae3855588c0f8518f..64c098aa097dc24211c5494f210d724b34f2e7ec 100644 (file)
@@ -51,6 +51,7 @@ $.widget( "ui.autocomplete", {
                                        event.preventDefault();
                                        break;
                                case keyCode.ENTER:
+                               case keyCode.NUMPAD_ENTER:
                                        // when menu is open or has focus
                                        if ( self.menu.active ) {
                                                event.preventDefault();
@@ -71,6 +72,12 @@ $.widget( "ui.autocomplete", {
                                case keyCode.SHIFT:
                                case keyCode.CONTROL:
                                case keyCode.ALT:
+                               case keyCode.COMMAND:
+                               case keyCode.COMMAND_RIGHT:
+                               case keyCode.INSERT:
+                               case keyCode.CAPS_LOCK:
+                               case keyCode.END:
+                               case keyCode.HOME:
                                        // ignore metakeys (shift, ctrl, alt)
                                        break;
                                default: