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", {
4343 return ;
4444 }
4545
46+ var suppressKeyPress = false ;
4647 var keyCode = $ . ui . keyCode ;
4748 switch ( event . keyCode ) {
4849 case keyCode . PAGE_UP :
@@ -65,6 +66,7 @@ $.widget( "ui.autocomplete", {
6566 case keyCode . NUMPAD_ENTER :
6667 // when menu is open or has focus
6768 if ( self . menu . element . is ( ":visible" ) ) {
69+ suppressKeyPress = true ;
6870 event . preventDefault ( ) ;
6971 }
7072 //passthrough - ENTER and TAB both select the current element
@@ -91,6 +93,12 @@ $.widget( "ui.autocomplete", {
9193 break ;
9294 }
9395 } )
96+ . bind ( "keypress.autocomplete" , function ( event ) {
97+ if ( suppressKeyPress ) {
98+ suppressKeyPress = false ;
99+ event . preventDefault ( ) ;
100+ }
101+ } )
94102 . bind ( "focus.autocomplete" , function ( ) {
95103 if ( self . options . disabled ) {
96104 return ;
You can’t perform that action at this time.
0 commit comments