Fix regressed autocomplete changes

also update the patch file
This commit is contained in:
Toks
2014-10-17 12:29:38 -04:00
committed by r888888888
parent b3dbd0be4c
commit dbe4a7ebf6
2 changed files with 19 additions and 17 deletions

View File

@@ -107,19 +107,9 @@ $.widget( "ui.autocomplete", {
suppressKeyPress = true;
this._keyEvent( "next", event );
break;
case keyCode.SPACE:
case keyCode.ENTER:
// when menu is open and has focus
if ( this.menu.active ) {
// #6055 - Opera still allows the keypress to occur
// which causes forms to submit
suppressKeyPress = true;
event.preventDefault();
this.menu.select( event );
}
break;
case keyCode.TAB:
if ( this.menu.active ) {
event.preventDefault();
this.menu.select( event );
}
break;

View File

@@ -1,5 +1,5 @@
--- jquery-ui-autocomplete-1.11.2.js 2014-10-16 15:17:29.000000000 -0700
+++ jquery-ui-autocomplete-custom.js 2014-10-16 15:16:59.000000000 -0700
--- jquery-ui-autocomplete-1.11.2.js Fri Oct 17 12:17:55 2014
+++ jquery-ui-autocomplete-custom.js Fri Oct 17 12:27:14 2014
@@ -68,6 +68,16 @@
.attr( "autocomplete", "off" );
@@ -17,11 +17,23 @@
keydown: function( event ) {
if ( this.element.prop( "readOnly" ) ) {
suppressKeyPress = true;
@@ -97,6 +107,7 @@
@@ -97,18 +107,9 @@
suppressKeyPress = true;
this._keyEvent( "next", event );
break;
+ case keyCode.SPACE:
case keyCode.ENTER:
// when menu is open and has focus
- case keyCode.ENTER:
- // when menu is open and has focus
- if ( this.menu.active ) {
- // #6055 - Opera still allows the keypress to occur
- // which causes forms to submit
- suppressKeyPress = true;
- event.preventDefault();
- this.menu.select( event );
- }
- break;
case keyCode.TAB:
if ( this.menu.active ) {
+ event.preventDefault();
this.menu.select( event );
}
break;