--- 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" ); this._on( this.element, { + click: function(event) { + if ( this.menu.element.is( ":visible" ) ) { + this._value( this.term ); + this.close( event ); + // Different browsers have different default behavior for escape + // Single press can mean undo or clear + // Double press in IE means clear the whole form + event.preventDefault(); + } + }, keydown: function( event ) { if ( this.element.prop( "readOnly" ) ) { suppressKeyPress = true; @@ -97,18 +107,9 @@ suppressKeyPress = true; this._keyEvent( "next", event ); break; - 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;