File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ $.widget( "ui.autocomplete", {
43
43
return ;
44
44
}
45
45
46
+ var suppressKeyPress = false ;
46
47
var keyCode = $ . ui . keyCode ;
47
48
switch ( event . keyCode ) {
48
49
case keyCode . PAGE_UP :
@@ -65,6 +66,7 @@ $.widget( "ui.autocomplete", {
65
66
case keyCode . NUMPAD_ENTER :
66
67
// when menu is open or has focus
67
68
if ( self . menu . element . is ( ":visible" ) ) {
69
+ suppressKeyPress = true ;
68
70
event . preventDefault ( ) ;
69
71
}
70
72
//passthrough - ENTER and TAB both select the current element
@@ -91,6 +93,12 @@ $.widget( "ui.autocomplete", {
91
93
break ;
92
94
}
93
95
} )
96
+ . bind ( "keypress.autocomplete" , function ( event ) {
97
+ if ( suppressKeyPress ) {
98
+ suppressKeyPress = false ;
99
+ event . preventDefault ( ) ;
100
+ }
101
+ } )
94
102
. bind ( "focus.autocomplete" , function ( ) {
95
103
if ( self . options . disabled ) {
96
104
return ;
You can’t perform that action at this time.
0 commit comments