diff --git a/vendor/assets/javascripts/jquery-ui-autocomplete-custom.js b/vendor/assets/javascripts/jquery-ui-autocomplete-custom.js index e9b113745..89a360afe 100644 --- a/vendor/assets/javascripts/jquery-ui-autocomplete-custom.js +++ b/vendor/assets/javascripts/jquery-ui-autocomplete-custom.js @@ -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; diff --git a/vendor/assets/javascripts/jquery-ui-autocomplete.patch b/vendor/assets/javascripts/jquery-ui-autocomplete.patch index 9a4ea1f31..c5bd71937 100644 --- a/vendor/assets/javascripts/jquery-ui-autocomplete.patch +++ b/vendor/assets/javascripts/jquery-ui-autocomplete.patch @@ -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;