mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Autocomplete: Ignore command (left and right/menu/windows), insert, caps lock, home, end keys.
Fixes #5415 - Catch all common keys while typing a word.
This commit is contained in:
parent
3570c1f768
commit
cb7eb69973
7
ui/jquery.ui.autocomplete.js
vendored
7
ui/jquery.ui.autocomplete.js
vendored
@ -51,6 +51,7 @@ $.widget( "ui.autocomplete", {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
case keyCode.ENTER:
|
case keyCode.ENTER:
|
||||||
|
case keyCode.NUMPAD_ENTER:
|
||||||
// when menu is open or has focus
|
// when menu is open or has focus
|
||||||
if ( self.menu.active ) {
|
if ( self.menu.active ) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@ -71,6 +72,12 @@ $.widget( "ui.autocomplete", {
|
|||||||
case keyCode.SHIFT:
|
case keyCode.SHIFT:
|
||||||
case keyCode.CONTROL:
|
case keyCode.CONTROL:
|
||||||
case keyCode.ALT:
|
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)
|
// ignore metakeys (shift, ctrl, alt)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user